Fix \dT enum in psql

Started by David Fetterover 18 years ago11 messagespatches
Jump to latest
#1David Fetter
david@fetter.org

Folks,

In psql, \dT doesn't show the elements for enums. Please find patch
vs. CVS TIP attached which fixes this per the following TODO item:

http://archives.postgresql.org/pgsql-hackers/2008-01/msg00826.php

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Attachments:

psql_enum.patchtext/plain; charset=us-asciiDownload+11-0
#2Andrew Dunstan
andrew@dunslane.net
In reply to: David Fetter (#1)
Re: Fix \dT enum in psql

David Fetter wrote:

Folks,

In psql, \dT doesn't show the elements for enums. Please find patch
vs. CVS TIP attached which fixes this per the following TODO item:

http://archives.postgresql.org/pgsql-hackers/2008-01/msg00826.php

I don't have a particular problem with this patch - indeed the query in
it looks eerily familiar :-)

However, I'm wondering if we should wait until a possible rework of the
mechanics of enums as recently discussed? Or we could put it in and that
way it would have to be redone when enums are rejigged.

cheers

andrew

#3David Fetter
david@fetter.org
In reply to: Andrew Dunstan (#2)
Re: Fix \dT enum in psql

On Thu, May 01, 2008 at 10:53:00PM -0400, Andrew Dunstan wrote:

David Fetter wrote:

Folks,

In psql, \dT doesn't show the elements for enums. Please find
patch vs. CVS TIP attached which fixes this per the following TODO
item:

http://archives.postgresql.org/pgsql-hackers/2008-01/msg00826.php

I don't have a particular problem with this patch - indeed the query
in it looks eerily familiar :-)

I can't imagine why ;)

However, I'm wondering if we should wait until a possible rework of
the mechanics of enums as recently discussed? Or we could put it in
and that way it would have to be redone when enums are rejigged.

I'm thinking getting it in there soon will keep the bitrot to a
minimum. One thing it doesn't include is regression tests. Shall I
add a few?

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#4Andrew Dunstan
andrew@dunslane.net
In reply to: David Fetter (#3)
Re: Fix \dT enum in psql

David Fetter wrote:

On Thu, May 01, 2008 at 10:53:00PM -0400, Andrew Dunstan wrote:

David Fetter wrote:

Folks,

In psql, \dT doesn't show the elements for enums. Please find
patch vs. CVS TIP attached which fixes this per the following TODO
item:

http://archives.postgresql.org/pgsql-hackers/2008-01/msg00826.php

I don't have a particular problem with this patch - indeed the query
in it looks eerily familiar :-)

I can't imagine why ;)

However, I'm wondering if we should wait until a possible rework of
the mechanics of enums as recently discussed? Or we could put it in
and that way it would have to be redone when enums are rejigged.

I'm thinking getting it in there soon will keep the bitrot to a
minimum. One thing it doesn't include is regression tests. Shall I
add a few?

not sure that we do regression tests for psql features ...

cheers

andrew

#5Andrew Dunstan
andrew@dunslane.net
In reply to: David Fetter (#1)
Re: Fix \dT enum in psql

David Fetter wrote:

Folks,

In psql, \dT doesn't show the elements for enums. Please find patch
vs. CVS TIP attached which fixes this per the following TODO item:

http://archives.postgresql.org/pgsql-hackers/2008-01/msg00826.php

I notice that this patch adds an "Elements" column to the output of \dT,
which will only be used by enum types. That seems rather ... cluttered.

cheers

andrew

#6David Fetter
david@fetter.org
In reply to: Andrew Dunstan (#5)
Re: Fix \dT enum in psql

On Sun, May 04, 2008 at 06:40:51PM -0400, Andrew Dunstan wrote:

David Fetter wrote:

Folks,

In psql, \dT doesn't show the elements for enums. Please find
patch vs. CVS TIP attached which fixes this per the following TODO
item:

http://archives.postgresql.org/pgsql-hackers/2008-01/msg00826.php

I notice that this patch adds an "Elements" column to the output of
\dT, which will only be used by enum types. That seems rather ...
cluttered.

Is the name too long, or did you want it rolled into one of the other
columns, or...?

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#5)
Re: Fix \dT enum in psql

Andrew Dunstan <andrew@dunslane.net> writes:

I notice that this patch adds an "Elements" column to the output of \dT,
which will only be used by enum types. That seems rather ... cluttered.

But it'll only be in \dT+ anyway, no?

regards, tom lane

#8Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#7)
Re: Fix \dT enum in psql

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

I notice that this patch adds an "Elements" column to the output of \dT,
which will only be used by enum types. That seems rather ... cluttered.

But it'll only be in \dT+ anyway, no?

Not in this patch.

cheers

andrew

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#8)
Re: Fix \dT enum in psql

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

But it'll only be in \dT+ anyway, no?

Not in this patch.

Hmmm ... given that a long list of enum members would bloat the output
quite a lot, I think I'd vote for putting it in \dT+.

regards, tom lane

#10David Fetter
david@fetter.org
In reply to: Tom Lane (#9)
Re: Fix \dT enum in psql

On Sun, May 04, 2008 at 07:49:25PM -0400, Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

But it'll only be in \dT+ anyway, no?

Not in this patch.

Hmmm ... given that a long list of enum members would bloat the
output quite a lot, I think I'd vote for putting it in \dT+.

Here's one where it's only in \dT+

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Attachments:

psql_enum-2.patchtext/plain; charset=us-asciiDownload+14-14
#11Andrew Dunstan
andrew@dunslane.net
In reply to: David Fetter (#10)
Re: Fix \dT enum in psql

David Fetter wrote:

On Sun, May 04, 2008 at 07:49:25PM -0400, Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

But it'll only be in \dT+ anyway, no?

Not in this patch.

Hmmm ... given that a long list of enum members would bloat the
output quite a lot, I think I'd vote for putting it in \dT+.

Here's one where it's only in \dT+

Yeah. Committed.

cheers

andrew