Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 12:28 AM
Alexander Cohen
Guest
 
Posts: n/a
Default How to list domains

How can i get list of all domains available?

thanks!

--
Alexander Cohen
http://www.toomuchspace.com
(819) 348-9237
(819) 432-3443


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

  #2  
Old November 23rd, 2005, 12:29 AM
Bruce Momjian
Guest
 
Posts: n/a
Default Re: How to list domains

Alexander Cohen wrote:[color=blue]
> How can i get list of all domains available?[/color]

Using psql, domains are listed with \dD. They also appear in \dT.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

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

http://archives.postgresql.org

  #3  
Old November 23rd, 2005, 12:29 AM
Alexander Cohen
Guest
 
Posts: n/a
Default Re: How to list domains

Yes, i just discovered that. Thanks! Actually im trying to display in
an app of mine a list of all types to the user. That goes fine but i
noticed that that list does not have "integer", "double precision" and
simple type names like that. I thought they would be domains. But i
guess they are not. Where can i find these types? What are they?

--
Alexander Cohen
http://www.toomuchspace.com
(819) 348-9237
(819) 432-3443


On Apr 7, 2004, at 2:47 PM, Bruce Momjian wrote:
[color=blue]
> Alexander Cohen wrote:[color=green]
>> How can i get list of all domains available?[/color]
>
> Using psql, domains are listed with \dD. They also appear in \dT.
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman@candle.pha.pa.us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania
> 19073
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>[/color]


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

  #4  
Old November 23rd, 2005, 12:29 AM
Bruce Momjian
Guest
 
Posts: n/a
Default Re: How to list domains

Alexander Cohen wrote:[color=blue]
> Yes, i just discovered that. Thanks! Actually im trying to display in
> an app of mine a list of all types to the user. That goes fine but i
> noticed that that list does not have "integer", "double precision" and
> simple type names like that. I thought they would be domains. But i
> guess they are not. Where can i find these types? What are they?[/color]

They are SQL-standard names for our int4, float8 types. They map
internally to those types. I don't know a way to list separately.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

  #5  
Old November 23rd, 2005, 12:29 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: How to list domains

Bruce Momjian <pgman@candle.pha.pa.us> writes:[color=blue]
> They are SQL-standard names for our int4, float8 types. They map
> internally to those types. I don't know a way to list separately.[/color]

You can use format_type() to get the canonical per-spec form. For instance

regression=# select typname, format_type(oid,-1) from pg_type where oid in (1043,23);
typname | format_type
---------+-------------------
varchar | character varying
int4 | integer
(2 rows)

I don't know of any way to get a listing of secondary aliases that the
parser will recognize (such as "int" for int4). They're hardwired into
the grammar rather than being table entries anywhere. Fortunately,
there are not all that many beyond the typname and the format_type forms.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles