Skip to content

Commit e6557e9

Browse files
author
Neil Conway
committed
Include information about a domain's CHECK constraint, if any, in the
output of \dD in psql. From Greg Sabino Mullane.
1 parent 00a1b1e commit e6557e9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/bin/psql/describe.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.114 2005/04/01 05:30:38 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.115 2005/04/06 05:23:32 neilc Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "describe.h"
@@ -1579,14 +1579,17 @@ listDomains(const char *pattern)
15791579
" WHEN t.typnotnull AND t.typdefault IS NULL THEN 'not null'\n"
15801580
" WHEN NOT t.typnotnull AND t.typdefault IS NOT NULL THEN 'default '||t.typdefault\n"
15811581
" ELSE ''\n"
1582-
" END as \"%s\"\n"
1582+
" END as \"%s\",\n"
1583+
" pg_catalog.pg_get_constraintdef(r.oid, true) as \"%s\"\n"
15831584
"FROM pg_catalog.pg_type t\n"
15841585
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n"
1586+
" LEFT JOIN pg_catalog.pg_constraint r ON t.oid = r.contypid\n"
15851587
"WHERE t.typtype = 'd'\n",
15861588
_("Schema"),
15871589
_("Name"),
15881590
_("Type"),
1589-
_("Modifier"));
1591+
_("Modifier"),
1592+
_("Check"));
15901593

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy