On Wed, Aug 09, 2006 at 10:44:22AM -0400, Robert Treat wrote:
> Is there a way to determine which datatypes take a length argument (eg.
> varchar, time, etc...) by looking in the system catalogs? pg_type doesnt seem
> to have the info... or is there a single place in the back end code that
> contains this info?
Sure, wherever the typlen column in pg_type is -1. In that column,
positive is fixed length, -1 is a verlena type and -2 is null
terminated (for cstring).
In the backend this info is available using get_typlenbyval() or a few
other functions, see utils/cache/lsyscache.c
Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.