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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgadmin-hackers by date

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