Обсуждение: BUG #2907: pg_get_serial_sequence quoting

Поиск
Список
Период
Сортировка

BUG #2907: pg_get_serial_sequence quoting

От
"Adriaan van Os"
Дата:
The following bug has been logged online:

Bug reference:      2907
Logged by:          Adriaan van Os
Email address:      postgres@microbizz.nl
PostgreSQL version: 8.1.4
Operating system:   Mac OS X 10.4.6, intel
Description:        pg_get_serial_sequence quoting
Details:

In order to work with capitals (etc.), the table_name parameter of
pg_get_serial_sequence needs double quotes inside single quotes, the
column_name parameter requires a name within single quotes only.

Re: BUG #2907: pg_get_serial_sequence quoting

От
Bruce Momjian
Дата:
Adriaan van Os wrote:
>
> The following bug has been logged online:
>
> Bug reference:      2907
> Logged by:          Adriaan van Os
> Email address:      postgres@microbizz.nl
> PostgreSQL version: 8.1.4
> Operating system:   Mac OS X 10.4.6, intel
> Description:        pg_get_serial_sequence quoting
> Details:
>
> In order to work with capitals (etc.), the table_name parameter of
> pg_get_serial_sequence needs double quotes inside single quotes, the
> column_name parameter requires a name within single quotes only.

I can confirm this is still a problem in current CVS:

    test=> CREATE TABLE "Test" ("Xx" SERIAL);
    NOTICE:  CREATE TABLE will create implicit sequence "Test_Xx_seq" for serial column "Test.Xx"
    CREATE TABLE
    test=> SELECT pg_get_serial_sequence('Test', 'xX');
    ERROR:  relation "test" does not exist
    test=> SELECT pg_get_serial_sequence('"Test"', 'Xx');
     pg_get_serial_sequence
    ------------------------
     PUBLIC."Test_Xx_seq"
    (1 row)

    test=> SELECT pg_get_serial_sequence('"Test"', 'xx');
    ERROR:  column "xx" of relation "Test" does not exist

Strangely, this was reported before, but not until November of 2006:

    http://archives.postgresql.org/pgsql-general/2006-11/msg01111.php

We have it in the queue to review for 8.3.  Hopefully there will a
change or documentation addition for this in 8.3.

--
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Re: BUG #2907: pg_get_serial_sequence quoting

От
Tom Lane
Дата:
Bruce Momjian <bruce@momjian.us> writes:
> Adriaan van Os wrote:
>> In order to work with capitals (etc.), the table_name parameter of
>> pg_get_serial_sequence needs double quotes inside single quotes, the
>> column_name parameter requires a name within single quotes only.

> I can confirm this is still a problem in current CVS:

This is not a bug, only a documentation issue.

            regards, tom lane

Re: BUG #2907: pg_get_serial_sequence quoting

От
Adriaan van Os
Дата:
Bruce Momjian wrote:

> Strangely, this was reported before, but not until November of 2006:
>
>     http://archives.postgresql.org/pgsql-general/2006-11/msg01111.php

That was a follow up on this thread
<http://archives.postgresql.org/pgsql-hackers/2004-10/msg00964.php>.

Regards,

Adriaan van Os