Re: derive the sequence name of a column - Mailing list pgsql-novice

From Stephan Szabo
Subject Re: derive the sequence name of a column
Date
Msg-id 20031031074859.G87061@megazone.bigpanda.com
Whole thread Raw
In response to Re: derive the sequence name of a column  ("Mel Jamero" <mel@gmanmi.tv>)
List pgsql-novice
On Fri, 31 Oct 2003, Mel Jamero wrote:

> Works fine with 7.2.2.  Thanks!  I still can't figure it out in 7.1.3
>
> There's no pg_namespace there.  Any ideas?

I think you can just remove the join with pg_namespace and the associated
where clauses (the nspname one and the join condition one).  I'm not
sure if there'll be any other problems since I don't currently have a
7.1.x system to try against.

And, for good measure, if you're running 7.1.x, you should really upgrade
soon. ;)

> select pg_attrdef.* from pg_attrdef, pg_namespace, pg_class,
> pg_attribute
> where pg_namespace.nspname='public' and
> pg_class.relnamespace=pg_namespace.oid and pg_class.relname='test' and
> pg_attribute.attrelid=pg_class.oid and pg_attribute.attname='test_id'
> and
> pg_attrdef.adrelid=pg_class.oid and
> pg_attrdef.adnum=pg_attribute.attnum;
>
> (filling in the schema, table name and column name for the constants).

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly

pgsql-novice by date:

Previous
From: "Kurt Derichs"
Date:
Subject: Tool to generate input forms?
Next
From: Oleg Bartunov
Date:
Subject: Re: [OT] Unable to access PostgreSQL mailing list archive