attribute names & typecast/psql default port 
Author Message
 attribute names & typecast/psql default port

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--583741998-1196000423-999945912=:17361
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hi all,

I found a few bugs this afternoon - Patch attached. Patch was generated
from current source and tested with the regression tests.

...

============== shutting down postmaster               ==============

======================
 All 77 tests passed.
======================

...

----

Bug #1: attribute name when column is type cast:

Given the following table:

test=# \d f
          Table "f"
 Column |  Type   | Modifiers
--------+---------+-----------
 i      | integer |
 test   | text    |

If I do the following:

test=# insert into f values(1,'test');
INSERT 139549 1
test=# select i::int8,test from f;
 ?column? | test
----------+------
        1 | test
(1 row)

It doesn't make much sense that the first column should be called
'?column?'.

The patch results in the output appearing like this:

test=# select i::int8,test from f;
 i | test
---+------
 1 | test
(1 row)

----------

Bug #2

Found this while testing the first patch. As it happens I only have one
box handy and it was running PG already. I changed the default port to
9999. When I executed bin/psql (the freshly built psql) it connected to my
production postmaster on port 5432.

The patch sets the configured port to that defined in pg_config.h.

Gavin

--583741998-1196000423-999945912=:17361
Content-Type: APPLICATION/x-gzip; name="999944667.pg.patch.gz"
Content-Transfer-Encoding: BASE64

Content-Description:
Content-Disposition: attachment; filename="999944667.pg.patch.gz"

H4sICOrxmTsAAzk5OTk0NDY2Ny5wZy5wYXRjaAC9U11v0zAUfXZ/xe0LcrLm
k6a0nkCaWIcmTaJawnNkkps2oo2N7Q7Q/jx2kolW2yQeEHnIx7HP8T33nvi+
D2GkVRV95dU37OpIcqVRDY/ScLVFE1ahUO2W5NxAjhJgCcmSZSuWpJDGcTIJ
guBvVM4EVmyesDQbBPzzy33DfJHO5osl9AAAiXzIxQFBNGB2qBG4QkCuW9QG
jIBawI/W7NwiHDujeKcboQ5YQydqBD9yItpuqXZAHVTwLVWoH/je89za42QK
hJCKW+2ivK2xM8zhhCg0R9UBpT0IvgcjL/jQ8QNe9rtG3pUxaqQ99o3pfbxL
wL4H/9HHWE7xS+JHrg2Dwd1ghQI9dUPp07Yzb3Zso0PPuxzop9L/pEP+nwC2
XST1932kbV7MUb6UuhXL5uxt9ix1z6inrDRmlpjEr0ctWcSzZJENUXOyA7B8
mpkrdoiyO6UU0rSi09T2p5rZ8W0fZvBmBD1ndXIBpG3odMRCKZTxHEhOEXgP
P7VR9VHS6/VNufm0+XxflHlxbzUu+jPbBuhUavvvSEsMjbs1Le5r66wfNXll
8Vz66stdUd7cru+uy3y96St8UVphJdSg/RvsMgpRGAQAAA==

--583741998-1196000423-999945912=:17361
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

--583741998-1196000423-999945912=:17361--



Wed, 25 Feb 2004 18:53:50 GMT
 attribute names & typecast/psql default port

Quote:
Gavin Sherry writes:
> Found this while testing the first patch. As it happens I only have one
> box handy and it was running PG already. I changed the default port to
> 9999. When I executed bin/psql (the freshly built psql) it connected to my
> production postmaster on port 5432.

> The patch sets the configured port to that defined in pg_config.h.

I'm not sure I believe that, because I rely on the correct behaviour every
day and I'm sure so do others.  (In fact, your patch would break other
things, such as the PGPORT environment variable.)

The sort of problem you describe is usually caused by psql using the wrong
libpq library (where the default port number is recorded).  I suggest you
run 'ldd psql' to see which one it picks up.

--

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Wed, 25 Feb 2004 20:13:30 GMT
 attribute names & typecast/psql default port

Quote:

> Gavin Sherry writes:

> > Found this while testing the first patch. As it happens I only have one
> > box handy and it was running PG already. I changed the default port to
> > 9999. When I executed bin/psql (the freshly built psql) it connected to my
> > production postmaster on port 5432.

> > The patch sets the configured port to that defined in pg_config.h.

> I'm not sure I believe that, because I rely on the correct behaviour every
> day and I'm sure so do others.  (In fact, your patch would break other
> things, such as the PGPORT environment variable.)

> The sort of problem you describe is usually caused by psql using the wrong
> libpq library (where the default port number is recorded).  I suggest you
> run 'ldd psql' to see which one it picks up.

It looks that way. My bad - thanks for pointing it out.

Gavin

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command



Thu, 26 Feb 2004 00:48:13 GMT
 attribute names & typecast/psql default port

So bug #1 patch should be applied, and not bug #2 part?

Quote:
> Hi all,

> I found a few bugs this afternoon - Patch attached. Patch was generated
> from current source and tested with the regression tests.

> ...

> ============== shutting down postmaster               ==============

> ======================
>  All 77 tests passed.
> ======================

> ...

> ----

> Bug #1: attribute name when column is type cast:

> Given the following table:

> test=# \d f
>           Table "f"
>  Column |  Type   | Modifiers
> --------+---------+-----------
>  i      | integer |
>  test   | text    |

> If I do the following:

> test=# insert into f values(1,'test');
> INSERT 139549 1
> test=# select i::int8,test from f;
>  ?column? | test
> ----------+------
>         1 | test
> (1 row)

> It doesn't make much sense that the first column should be called
> '?column?'.

> The patch results in the output appearing like this:

> test=# select i::int8,test from f;
>  i | test
> ---+------
>  1 | test
> (1 row)

> ----------

> Bug #2

> Found this while testing the first patch. As it happens I only have one
> box handy and it was running PG already. I changed the default port to
> 9999. When I executed bin/psql (the freshly built psql) it connected to my
> production postmaster on port 5432.

> The patch sets the configured port to that defined in pg_config.h.

> Gavin

Content-Description:

[ Attachment, skipping... ]

Quote:

> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
  Bruce Momjian                        |  http://candle.pha.pa.us

  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Thu, 26 Feb 2004 09:20:13 GMT
 attribute names & typecast/psql default port
Correct. (Unless anyone can find if it busts anything which regression
would not find?)

Thanks

Gavin

Quote:

> So bug #1 patch should be applied, and not bug #2 part?

> > Hi all,

> > I found a few bugs this afternoon - Patch attached. Patch was generated
> > from current source and tested with the regression tests.

> > ...

> > ============== shutting down postmaster               ==============

> > ======================
> >  All 77 tests passed.
> > ======================

> > ...

> > ----

> > Bug #1: attribute name when column is type cast:

> > Given the following table:

> > test=# \d f
> >           Table "f"
> >  Column |  Type   | Modifiers
> > --------+---------+-----------
> >  i      | integer |
> >  test   | text    |

> > If I do the following:

> > test=# insert into f values(1,'test');
> > INSERT 139549 1
> > test=# select i::int8,test from f;
> >  ?column? | test
> > ----------+------
> >         1 | test
> > (1 row)

> > It doesn't make much sense that the first column should be called
> > '?column?'.

> > The patch results in the output appearing like this:

> > test=# select i::int8,test from f;
> >  i | test
> > ---+------
> >  1 | test
> > (1 row)

> > ----------

> > Bug #2

> > Found this while testing the first patch. As it happens I only have one
> > box handy and it was running PG already. I changed the default port to
> > 9999. When I executed bin/psql (the freshly built psql) it connected to my
> > production postmaster on port 5432.

> > The patch sets the configured port to that defined in pg_config.h.

> > Gavin

> Content-Description:

> [ Attachment, skipping... ]

> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate

message can get through to the mailing list cleanly


Thu, 26 Feb 2004 11:17:51 GMT
 attribute names & typecast/psql default port

First part only.

Your patch has been added to the PostgreSQL unapplied patches list at:

        http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

Quote:
> Hi all,

> I found a few bugs this afternoon - Patch attached. Patch was generated
> from current source and tested with the regression tests.

> ...

> ============== shutting down postmaster               ==============

> ======================
>  All 77 tests passed.
> ======================

> ...

> ----

> Bug #1: attribute name when column is type cast:

> Given the following table:

> test=# \d f
>           Table "f"
>  Column |  Type   | Modifiers
> --------+---------+-----------
>  i      | integer |
>  test   | text    |

> If I do the following:

> test=# insert into f values(1,'test');
> INSERT 139549 1
> test=# select i::int8,test from f;
>  ?column? | test
> ----------+------
>         1 | test
> (1 row)

> It doesn't make much sense that the first column should be called
> '?column?'.

> The patch results in the output appearing like this:

> test=# select i::int8,test from f;
>  i | test
> ---+------
>  1 | test
> (1 row)

> ----------

> Bug #2

> Found this while testing the first patch. As it happens I only have one
> box handy and it was running PG already. I changed the default port to
> 9999. When I executed bin/psql (the freshly built psql) it connected to my
> production postmaster on port 5432.

> The patch sets the configured port to that defined in pg_config.h.

> Gavin

Content-Description:

[ Attachment, skipping... ]

Quote:

> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
  Bruce Momjian                        |  http://candle.pha.pa.us

  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

---------------------------(end of broadcast)---------------------------



Thu, 26 Feb 2004 11:18:54 GMT
 attribute names & typecast/psql default port

First bug patch applied, port patch skipped.  Thanks.

Quote:
> Hi all,

> I found a few bugs this afternoon - Patch attached. Patch was generated
> from current source and tested with the regression tests.

> ...

> ============== shutting down postmaster               ==============

> ======================
>  All 77 tests passed.
> ======================

> ...

> ----

> Bug #1: attribute name when column is type cast:

> Given the following table:

> test=# \d f
>           Table "f"
>  Column |  Type   | Modifiers
> --------+---------+-----------
>  i      | integer |
>  test   | text    |

> If I do the following:

> test=# insert into f values(1,'test');
> INSERT 139549 1
> test=# select i::int8,test from f;
>  ?column? | test
> ----------+------
>         1 | test
> (1 row)

> It doesn't make much sense that the first column should be called
> '?column?'.

> The patch results in the output appearing like this:

> test=# select i::int8,test from f;
>  i | test
> ---+------
>  1 | test
> (1 row)

> ----------

> Bug #2

> Found this while testing the first patch. As it happens I only have one
> box handy and it was running PG already. I changed the default port to
> 9999. When I executed bin/psql (the freshly built psql) it connected to my
> production postmaster on port 5432.

> The patch sets the configured port to that defined in pg_config.h.

> Gavin

Content-Description:

[ Attachment, skipping... ]

Quote:

> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
  Bruce Momjian                        |  http://candle.pha.pa.us

  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Fri, 27 Feb 2004 23:26:32 GMT
 attribute names & typecast/psql default port

Quote:

> It doesn't make much sense that the first column should be called
> '?column?'.

This patch is broken, since it assumes that the argument of a TypeCast
will always be an Ident.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Fri, 05 Mar 2004 00:48:53 GMT
 
 [ 8 post ] 

 Relevant Pages 

1. attribute names & typecast/psql default port

2. Do the Named SQL Server Instances Listen at the Same port as Default Instances

3. SQL default port vs. any other port

4. Host Name, Port and Net Service Name during installation of 9iLite

5. Bulk Load and xsd:default attribute doesn't work

6. How to make DIM default attribute

7. Bulk Load Default value for an attribute

8. SQL2K - Default name is name of computer, not (local)

9. psql - use of default editor

10. Change default settings of P.SQL 2000 client

11. psql: default base and password reading

12. psql default language


 
Powered by phpBB® Forum Software