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

From Tom Lane
Subject Re: Getting information about sequences
Date
Msg-id 3178.1147705870@sss.pgh.pa.us
Whole thread Raw
In response to Re: Getting information about sequences  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> 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:
> [ ideas snipped ]

Yeah (actually the point about the update-in-place code being relevant
had just occurred to me too).  However, none of these are really
desirable solutions from psql's point of view, because they could only
work in 8.2 and later (or whenever we implemented them).  It'd be nicer
if \ds still worked against back-rev servers, which means we need a
solution that works with the current server API.  I'm thinking that psql
will need to pull the main \ds query result, and then manually issue a
select against each of the sequences (ick).  On the other hand this may
be the best thing anyway, since it's entirely likely that some of those
selects would fail for permissions reasons, and we don't want the whole
\ds operation to go down in flames just because you don't have select
rights on one sequence.

            regards, tom lane

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Getting information about sequences
Next
From: Bruce Momjian
Date:
Subject: Re: [PORTS] Compiling on 8.1.3 on Openserver 5.05