Re: MetaData (size of datatype)
От | Shra |
---|---|
Тема | Re: MetaData (size of datatype) |
Дата | |
Msg-id | f0204291714560232@yaskatech.com обсуждение исходный текст |
Ответ на | ... (Shra <shravan@yaskatech.com>) |
Ответы |
Re: MetaData (size of datatype)
Re: MetaData (size of datatype) |
Список | pgsql-hackers |
Hi Hannu, > -1 is given for types that are of fixed size and whose length can be > read from pg_type.typlen for that type. I don't think so...jsut look into this file pq_type.h.... it says......... *****************************************************************typlen is the number of bytes we use to represent a valueof this type, e.g. 4 for an int4. But for a variable length type, typlen is -1 ***************************************************************** -1 is for variable length n not for fixed length.........this point is very clear even in documentation.......... now how to find length for a numeric, varchar or anyother one that has variable length where the system PQfsize returns -1.........? As tom said.....The type is encoded in the atttypmod field (see PQfmod) and recommended using format_type()..... but when this is used, it returns -1 for integer , real n other fixed datatypes ......... any better way , please......... Shra
В списке pgsql-hackers по дате отправления: