Re: [PATCHES] Fix \dT enum in psql

2008-05-04 Thread Andrew Dunstan



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

--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [PATCHES] Fix \dT enum in psql

2008-05-04 Thread David Fetter
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 [EMAIL PROTECTED] http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter  XMPP: [EMAIL PROTECTED]

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

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [PATCHES] Fix \dT enum in psql

2008-05-04 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] 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

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [PATCHES] Fix \dT enum in psql

2008-05-04 Thread Andrew Dunstan



Tom Lane wrote:

Andrew Dunstan [EMAIL PROTECTED] 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

--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [PATCHES] Fix \dT enum in psql

2008-05-04 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] 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

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [PATCHES] Fix \dT enum in psql

2008-05-04 Thread Andrew Dunstan



David Fetter wrote:

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

Andrew Dunstan [EMAIL PROTECTED] 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

--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [PATCHES] Fix \dT enum in psql

2008-05-01 Thread Andrew Dunstan



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



--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [PATCHES] Fix \dT enum in psql

2008-05-01 Thread David Fetter
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 [EMAIL PROTECTED] http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter  XMPP: [EMAIL PROTECTED]

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

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


[PATCHES] Fix \dT enum in psql

2008-04-08 Thread David Fetter
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 [EMAIL PROTECTED] http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter  XMPP: [EMAIL PROTECTED]

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
Index: src/bin/psql/describe.c
===
RCS file: /projects/cvsroot/pgsql/src/bin/psql/describe.c,v
retrieving revision 1.166
diff -c -c -r1.166 describe.c
*** src/bin/psql/describe.c 30 Mar 2008 18:10:20 -  1.166
--- src/bin/psql/describe.c 8 Apr 2008 20:29:01 -
***
*** 310,317 
--- 310,328 
END AS \%s\,\n,
  gettext_noop(Internal name),
  gettext_noop(Size));
+ 
appendPQExpBuffer(buf,
+ pg_catalog.array_to_string(\n
+   ARRAY(\n
+   SELECT e.enumlabel\n
+ FROM pg_catalog.pg_enum e\n
+ WHERE e.enumtypid = t.oid\n
+ ORDER BY e.oid\n
+ ),\n
+ E'\\n'\n
+ ) AS \%s\,\n
  pg_catalog.obj_description(t.oid, 'pg_type') 
as \%s\\n,
+ gettext_noop(Elements),
  gettext_noop(Description));
  
appendPQExpBuffer(buf, FROM pg_catalog.pg_type t\n

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches