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

Re: BUG #2907: pg_get_serial_sequence quoting

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Adriaan van Os <postgres(at)microbizz(dot)nl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2907: pg_get_serial_sequence quoting
Date: 2007-01-20 01:38:38
Message-ID: 200701200138.l0K1cc919181@momjian.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackerspgsql-patches
Adriaan van Os wrote:
> 
> The following bug has been logged online:
> 
> Bug reference:      2907
> Logged by:          Adriaan van Os
> Email address:      postgres(at)microbizz(dot)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(at)momjian(dot)us
  EnterpriseDB    http://www.enterprisedb.com

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

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2007-01-20 01:41:46
Subject: Re: O_DIRECT support for Windows
Previous:From: Greg Sabino MullaneDate: 2007-01-20 01:01:56
Subject: pg_dump pretty_print

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2007-01-20 02:14:17
Subject: Re: BUG #2889: Syntax error: WHERE ANY(arrayfield) = N
Previous:From: Devrim GUNDUZDate: 2007-01-19 23:37:23
Subject: Re: PostgreSQL & Slackware

pgsql-patches by date

Next:From: Bruce MomjianDate: 2007-01-20 01:41:46
Subject: Re: O_DIRECT support for Windows
Previous:From: Bruce MomjianDate: 2007-01-20 01:28:28
Subject: Re: guid/uuid datatype

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