Re: OID Usage - Mailing list pgsql-general

From Terry Lee Tucker
Subject Re: OID Usage
Date
Msg-id 200501141834.38188.terry@esc1.com
Whole thread Raw
In response to Re: OID Usage  (Bo Lorentsen <bl@netgroup.dk>)
List pgsql-general
It's not very hard to do. I just got rid them. It took me about a day. Our
application is an X-Windows front end written is C. I wrote a function to
return the next value of the serial key for any table. Here is the select
statement buitl with sprintf:
"SELECT relname FROM pg_class WHERE relkind = \'S\' AND
    relname = \'%s_recid_seq\':

All our sequences are called "recid" and since the naming convention is
<table_name>_recid_seq, it's easy to get the name of the right sequence. You
might as well go ahead and do it. You'll feel better after you do ;o)

On Friday 14 January 2005 06:13 pm, Bo Lorentsen saith:
> Alvaro Herrera wrote:
> >Yeah, though things get hairy that way because you have to peek at
> >pg_attribute to match the objsubid in pg_depend; and self-join pg_class
> >to get to the index itself.  Not sure if it all can be done in a single
> >query.
>
> Sounds like my task, to make an oid free insert/select,  is going to be
> very interesting :-)
>
> /BL
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
 Work: 1-336-372-6812
 Cell: 1-336-363-4719
email: terry@esc1.com

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: [HACKERS] Much Ado About COUNT(*)
Next
From: Tom Lane
Date:
Subject: Re: Parsing of backslash in statements via ODBC