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

Re: detecting serials in 8.1

From: Kris Jurka <books(at)ejurka(dot)com>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Subject: Re: detecting serials in 8.1
Date: 2006-02-19 22:14:17
Message-ID: 43F8EDB9.3010507@ejurka.com (view raw or flat)
Thread:
Lists: pgadmin-hackers
Andreas Pflug wrote:
> Kris Jurka wrote:
>> 8.1 has changed the default text for serials from something like
>> nextval('public.tab_col_seq'::text) to nextval('tab_col_seq'::regclass)
> 
> 
> Applied with editing (didn't check for schema).

Actually it turns out that whether the schema gets in there or not 
depends on the search path when the table is created.  Consider the 
following code:


CREATE schema s1;
CREATE schema s2;

SET search_path TO 's1';

CREATE TABLE t1 (a serial);
CREATE TABLE s2.t2 (a serial);

SET search_path TO 'public';

SELECT relname,attname,adsrc
FROM pg_class c, pg_attribute a, pg_attrdef d
WHERE c.oid = d.adrelid AND c.oid = a.attrelid
	AND a.attnum = d.adnum
	AND c.relname IN ('t1','t2');

In response to

Responses

pgadmin-hackers by date

Next:From: Andreas PflugDate: 2006-02-19 22:47:19
Subject: Re: detecting serials in 8.1
Previous:From: Dave PageDate: 2006-02-19 22:12:35
Subject: Re: SVN Commit by dpage: r5003 - in trunk/pgadmin3: . src/base

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