Skip site navigation (1) Skip section navigation (2)

pg_get_serial_sequence is inconsistent

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: pg_get_serial_sequence is inconsistent
Date: 2004-10-28 05:12:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
pg_get_serial_sequence() does dequoting/downcasing on its relation-name
argument, but not on its column-name argument.

regression=# create table "FOO" ("Ff1" serial);
NOTICE:  CREATE TABLE will create implicit sequence "FOO_Ff1_seq" for serial column "FOO.Ff1"
regression=# select pg_get_serial_sequence('FOO','Ff1');
ERROR:  column "Ff1" of relation "foo" does not exist
regression=# select pg_get_serial_sequence('"FOO"','Ff1');
(1 row)

regression=# select pg_get_serial_sequence('"FOO"','"Ff1"');
ERROR:  column ""Ff1"" of relation "FOO" does not exist

This seems pretty inconsistent.  I was expecting to find that it broke
pg_dump, as well, but it looks like pg_dump is expecting exactly
this behavior.

Should we change it?  We need the quote-aware behavior for the relation
name (because that could be schema-qualified) so the choices seem to be
status quo or add dequoting/downcasing to the column name argument.

			regards, tom lane


pgsql-hackers by date

Next:From: Christopher Kings-LynneDate: 2004-10-28 05:44:27
Subject: Re: pg_get_serial_sequence is inconsistent
Previous:From: Alvaro HerreraDate: 2004-10-28 04:30:31
Subject: Shared dependencies

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group