psql showing owner in \dT

Started by Magnus Haganderalmost 11 years ago3 messages
#1Magnus Hagander
magnus@hagander.net
1 attachment(s)

After running into the need twice now - is there a particular reason why we
don't have psql showing the owner of a type, at least in \dT+?

If not, how about attached trivial patch?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

Attachments:

psql_type_owner.patchtext/x-patch; charset=US-ASCII; name=psql_type_owner.patchDownload
*** a/src/bin/psql/describe.c
--- b/src/bin/psql/describe.c
***************
*** 533,538 **** describeTypes(const char *pattern, bool verbose, bool showSystem)
--- 533,544 ----
  		printACLColumn(&buf, "t.typacl");
  		appendPQExpBufferStr(&buf, ",\n  ");
  	}
+ 	if (verbose)
+ 	{
+ 		appendPQExpBuffer(&buf,
+ 						  "  pg_catalog.pg_get_userbyid(t.typowner) AS \"%s\",\n",
+ 						  gettext_noop("Owner"));
+ 	}
  
  	appendPQExpBuffer(&buf,
  				"  pg_catalog.obj_description(t.oid, 'pg_type') as \"%s\"\n",
#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Magnus Hagander (#1)
Re: psql showing owner in \dT

Magnus Hagander wrote:

After running into the need twice now - is there a particular reason why we
don't have psql showing the owner of a type, at least in \dT+?

Can't think of anything ...

If not, how about attached trivial patch?

Owner should normally be printed before ACL, no?

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

#3Magnus Hagander
magnus@hagander.net
In reply to: Alvaro Herrera (#2)
Re: psql showing owner in \dT

On Thu, Apr 9, 2015 at 3:27 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

Magnus Hagander wrote:

After running into the need twice now - is there a particular reason why

we

don't have psql showing the owner of a type, at least in \dT+?

Can't think of anything ...

If not, how about attached trivial patch?

Owner should normally be printed before ACL, no?

That's probably correct.

Done that way and pushed.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/