Re: Quick patch: Display sequence owner - Mailing list pgsql-hackers

From Josh Williams
Subject Re: Quick patch: Display sequence owner
Date
Msg-id 1228837584.22132.35.camel@godzilla.local.scalefeather.com
Whole thread Raw
In response to Re: Quick patch: Display sequence owner  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Quick patch: Display sequence owner  ("Jaime Casanova" <jcasanov@systemguards.com.ec>)
Re: Quick patch: Display sequence owner  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
On Tue, 2008-12-09 at 09:32 -0500, Tom Lane wrote:
> I think the place that such information could most naturally be squeezed
> into psql's \d commands would be to add another type of footer
> information to \dt, eg
> 
>         Table "foo.bar"
>     ...
>     Indexes:
>         "bari" ...
>     Owned sequences:
>         "baz" owned by col1

That makes more sense, though isn't that a little repetitive when
"default nextval(...)" is visible immediately above it?

Doesn't guarantee the sequence is owned by the table of course, but I'd
imagine to most people it'd just be noise.  Could see it being shown in
the verbose version, \d+ foo.bar.

I certainly like that better than "making up" an nonexistent column. :)

> If you really want to attach the information to the \d output for the
> sequence instead of the table, consider a similar footer-style display
> instead of making it look like something it's not.

For the sequences themselves, it'd be nice to show somewhere, at least
for tracking down stray sequences and identifying relationships.
Perhaps a function to do the reverse of pg_get_serial_sequence()?  Or
better yet if no one else is already working on it, a more generic way
to get readable information out of pg_depend?

> 
>             regards, tom lane
> 

- Josh Williams




pgsql-hackers by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: WIP: default values for function parameters
Next
From: "Dave Page"
Date:
Subject: Windows buildfarm members