Re: psql - TYPE DEFINITION

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: salah jubeh <s_jubeh(at)yahoo(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql - TYPE DEFINITION
Date: 2012-01-16 20:34:29
Message-ID: 4F1489D5.2010909@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/16/2012 09:44 AM, salah jubeh wrote:
> Hello Adrian
>
> when I run \dTS+ I get the same result as \dT+
>

So you want to get information from a user created type.
So you have two options:
1) Add a comment to the type:
COMMENT ON TYPE test is 'create type test AS (a int , b int)';

test=> \dT
List of data types
Schema | Name | Description
--------+---------+-------------------------------------
public | ghstore |
public | hstore |
public | test | create type test AS (a int , b int)

2) Get the information from the pg_type system catalog.

test=> SELECT * from pg_type where typname='test';

I am not showing the output because it does not display well.

For more information on what is being returned take a look at:

http://www.postgresql.org/docs/9.0/interactive/catalog-pg-type.html

>
> Regards
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2012-01-16 21:34:54 HA options
Previous Message Thom Brown 2012-01-16 20:19:33 Re: can't find data type CIText or CI_Text