[sf-perl] PostgreSQL DBD ---- repost: sorry,
I had the wrong subject in my previous post
Shane Hill
shanehill00 at gmail.com
Fri Apr 1 11:11:52 PST 2005
nice find david, this works well and is probably more bomb-proof than
concatenating strings and guessing the seq_name.
looks like I am buying a new poster this evening :-)
-Shane
> SELECT
> (string_to_array(d.adsrc, '\''))[2]
> FROM pg_catalog.pg_class c
> JOIN pg_catalog.pg_attribute a
> ON (
> c.relname = 'foo_tab'
> AND
> c.oid = a.attrelid
> )
> JOIN pg_catalog.pg_attrdef d
> ON (
> d.adsrc LIKE 'nextval%'
> AND
> d.adrelid = a.attrelid
> AND
> d.adnum = a.attnum
> )
> ;
>
> > thanks for your help, I really appreciate it.
>
> Hope this does. Oh, and try talking your client into upgrading to
> 8.0x :)
>
> Cheers,
> D
> --
> David Fetter david at fetter.org http://fetter.org/
> phone: +1 510 893 6100 mobile: +1 415 235 3778
>
> Remember to vote!
>
More information about the SanFrancisco-pm
mailing list