sql - PostgreSQL: How to list all available datatypes? -


question:

in postgresql (using sql, not console), how can list available datataypes ?

ideally this: http://www.java2s.com/code/postgresql/postgre-sql/displaysalldatatypesintheconnecteddatabasewithcomments.htm

it should list user defined types, if there any.
list in pgadmin3 define datatype new column in table.

"data types" in postgresql includes primitive (built-in) types, types added extensions, user-defined composite types, domains, , table rowtypes. isn't clear of these of interest you. types available in given database listed in database's pg_catalog.pg_type may need filter results. see the documentation pg_type system catalog table.

types available not installed extensions not listed. there's no way list types provided extensions not installed in current database.

to prettier listing of types use psql's \dt * command. can see underlying sql executes running psql -e flag:

$ psql -e regress regress=> \dt * ********* query ********** select n.nspname "schema",   pg_catalog.format_type(t.oid, null) "name",   pg_catalog.obj_description(t.oid, 'pg_type') "description" pg_catalog.pg_type t      left join pg_catalog.pg_namespace n on n.oid = t.typnamespace (t.typrelid = 0 or (select c.relkind = 'c' pg_catalog.pg_class c c.oid = t.typrelid))   , not exists(select 1 pg_catalog.pg_type el el.oid = t.typelem , el.typarray = t.oid)   , pg_catalog.pg_type_is_visible(t.oid) order 1, 2; ************************** 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -