Search Postgresql Archives

Re: column size in libpq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Apr 25, 2005, at 4:53 AM, Piotr Filipczuk wrote:

How to determinate column size in query in libpq? Especially when column is declared for exapmle as varchar(64). PQfsize return -1 which mean that is variable and PQfmod returns 68.

68 - 4 is the correct size for varchar(64). There is 4 bytes of overhead included in the return value.


If you are trying to do something like column formatting where you need to know the longest length, maybe take a look at the psql source and see how it works there.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux