I'm looking for a few ways to find a CREATE TYPE statement for an existing user defined type in a postgres (9.3.3) db.
So far I have tried 3 ways and seem to have failed on each: 1) An SQL Command? pg_catalog.get_pg_typdef does not seem to be implemented at this time. 2) A pg_dump sift? How does one dump a specific type? I don't see a type flag? I've tried "-s" for the schema only but I'd like to specify just the one type. 3) PgAdmin GUI The pgadmin gui is great! I'm running 1.18.1 And it seems to recognize that my user defined types exist (as dependencies of other known objects) but it does not show the create type SQL that I am looking for.
How do you overflowers find type definitions? I feel like I'm close with any of these. Thanks much!
PostgreSQL 9.3.3 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2), 64-bit
grep -i "your-type-name" your-dump-file. Is it a composite type, an enumerated type, a range type, or a base type? Do you know how it was created?pg_get_viewdef, but most functionality is inpg_dump, and not easily re-used or accessed on fine granularity.