From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "Forums (at) Existanze" <forums(at)existanze(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Getting information about sequences |
Date: | 2006-05-15 15:03:53 |
Message-ID: | 20060515150353.GD21506@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-05-15 15:11:10 | Re: Getting information about sequences |
Previous Message | Sebastian Böck | 2006-05-15 14:58:11 | Re: Bug in ordered views? |