Re: Getting information about sequences - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Getting information about sequences
Date
Msg-id 20060515150353.GD21506@svana.org
Whole thread Raw
In response to Re: Getting information about sequences  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Getting information about sequences  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Mon, May 15, 2006 at 10:44:15AM -0400, Tom Lane wrote:
> I haven't been able to think of a way to do that, unless you want to
> assume the existence of a plpgsql helper function.  There's an open
> request to list last_values in psql's "\ds", and it'd be real nice
> to be able to do it all in one query for that.

Long term I see a few ways of dealing with this:

- Pull that idea of storing all sequences in one table off the
shelf and implement it. The new heap up-date-in-place function may come
in handy there.

- Find a way of allowing functions to be declared inline, to avoid
creating system functions continuously. I don't know if there's
precedent for this.

- Create a function called: gettable(reloid) returns record, that takes
a relation OID and returns all the records in it. If all the tables
you're dealing with have a similar structure, you can use this to
iteratoe over, sequences just being a special case.

There's probably more, but that's all I can think of right now.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Getting information about sequences
Next
From: Tom Lane
Date:
Subject: Re: Getting information about sequences