Re: detecting serials in 8.1 - Mailing list pgadmin-hackers

From Andreas Pflug
Subject Re: detecting serials in 8.1
Date
Msg-id 43F8CE98.8040509@pse-consulting.de
Whole thread Raw
In response to detecting serials in 8.1  (Kris Jurka <books@ejurka.com>)
Responses Re: detecting serials in 8.1
List pgadmin-hackers
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).

> +     // Technically this serial check can still fail for sequences that
> +     // get created with non-default names.  Consider:
> +     // CREATE SEQUENCE st_a_seq;
> +     // CREATE TABLE st (a serial);
> +     // Now the default's sequence is actually st_a_seq1.

This can't be created consistently using the CREATE TABLE foo (bar
serial) syntax, instead the column default syntax would need to be used.
I've put this on the TODO list, we'd need some discussion what reverse
engineering we really should show in such cases. This also has to
correspond with our column dialog, which will add pg_depend
automatically if adding a serial to an existing table (thus mimicking
the CREATE TABLE ... SERIAL stuff).

Regards,
Andreas


pgadmin-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: SVN Commit by dpage: r5003 - in trunk/pgadmin3:
Next
From: svn@pgadmin.org
Date:
Subject: SVN Commit by andreas: r5009 - trunk/pgadmin3/src/schema