Where is information about user-defined types stored?
Are there some tables which contain information about the fields of a user-defined composite type, their names, etc.?
Use \l or \l+ in psql to show all databases in the current PostgreSQL server. Use the SELECT statement to query data from the pg_database to get all databases.
The PostgreSQL user-defined data type is used to generate user-defined data types with the help of Create DOMAIN and CREATE TYPE. The CREATE DOMAIN command is used to generate a user-defined data type with constraints such as CHECK, NOT NULL, etc.
SELECT * FROM spatial_ref_sys WHERE srtext LIKE '%\ /%'; Sometimes these ticks are very useful for searching special characters in a database.
The catalog pg_type stores information about data types. Base types and enum types (scalar types) are created with CREATE TYPE, and domains with CREATE DOMAIN.
More information about pg_type plz visit http://www.postgresql.org/docs/9.0/static/catalog-pg-type.html
Information about the fields constituting a composite type can be retrieved like this:
select * from pg_attribute where attrelid =
(select typrelid from pg_type where typname = 't_employee')
where t_employee
would be the name of the composite type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With