views:

45

answers:

2

Is there any way to find out particular datatype [say for example chkpass] is available or not through a query ?

A: 

run: psql -E

and then, in psql session \dT or \dTS

depesz
A: 

PostgreSQL provides a huge amount of meta-data which is easily accessed via SQL. To obtain information about the presence of a (scalar) data type, the information provided by pg_type catalog might be of interest here. Try, for example:

SELECT COUNT(*) 
FROM pg_type
WHERE typname = 'chkpass'
Dirk