Re: Getting information about sequences

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
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:11:10
Message-ID: 3178.1147705870@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2006-05-15 15:39:41 Re: [PORTS] Compiling on 8.1.3 on Openserver 5.05
Previous Message Martijn van Oosterhout 2006-05-15 15:03:53 Re: Getting information about sequences