Unix Technical Forum

Have psql \dD show checks

This is a discussion on Have psql \dD show checks within the Pgsql Patches forums, part of the PostgreSQL category; --> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Patch to show check information when listing domains via \dD in psql. Per ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:12 AM
Greg Sabino Mullane
 
Posts: n/a
Default Have psql \dD show checks


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Patch to show check information when listing domains via \dD in psql.
Per question by Edmund Bacon on the pgsql-general list.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200504030911
http://biglumber.com/x/web?pk=2529DF...9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFCT+t8vJuQZxSWSsgRAog3AJwOp8ac7xvgQ1lt2sDTu2 hwAr63hwCfYz2T
GqxgS3t64mF4Vn8Ie5n8hvo=
=a1GE
-----END PGP SIGNATURE-----


Index: describe.c
================================================== =================
RCS file: /projects/cvsroot/pgsql/src/bin/psql/describe.c,v
retrieving revision 1.114
diff -c -r1.114 describe.c
*** describe.c 1 Apr 2005 05:30:38 -0000 1.114
--- describe.c 3 Apr 2005 13:07:14 -0000
***************
*** 1579,1592 ****
" WHEN t.typnotnull AND t.typdefault IS NULL THEN 'not null'\n"
" WHEN NOT t.typnotnull AND t.typdefault IS NOT NULL THEN 'default '||t.typdefault\n"
" ELSE ''\n"
! " END as \"%s\"\n"
"FROM pg_catalog.pg_type t\n"
! " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n"
"WHERE t.typtype = 'd'\n",
_("Schema"),
_("Name"),
_("Type"),
! _("Modifier"));

processNamePattern(&buf, pattern, true, false,
"n.nspname", "t.typname", NULL,
--- 1579,1595 ----
" WHEN t.typnotnull AND t.typdefault IS NULL THEN 'not null'\n"
" WHEN NOT t.typnotnull AND t.typdefault IS NOT NULL THEN 'default '||t.typdefault\n"
" ELSE ''\n"
! " END as \"%s\",\n"
! " pg_catalog.pg_get_constraintdef(r.oid, true) as \"%s\"\n"
"FROM pg_catalog.pg_type t\n"
! " JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n"
! " LEFT JOIN pg_catalog.pg_constraint r ON t.oid = r.contypid\n"
"WHERE t.typtype = 'd'\n",
_("Schema"),
_("Name"),
_("Type"),
! _("Modifier"),
! _("Check"));

processNamePattern(&buf, pattern, true, false,
"n.nspname", "t.typname", NULL,



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:13 AM
Neil Conway
 
Posts: n/a
Default Re: Have psql \dD show checks

Greg Sabino Mullane wrote:
> Patch to show check information when listing domains via \dD in psql.
> Per question by Edmund Bacon on the pgsql-general list.


Patch applied, thanks. I didn't change the left join to pg_namespace to
be an inner join; while I think this is probably worth doing, it is a
separate issue. (Also, don't put semi-related, not-obviously-right
changes into patches without justifying them in the patch summary,
please )

-Neil

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:51 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com