Field size
On Sun, Jul 20, 2008 at 05:50:30PM -0500, Martin wrote:
Ok, this should be simple. How do I find the defined maximum
length of a varchar field?
http://www.postgresql.org/docs/faqs.FAQ.html#item4.4
depesz
hubert depesz lubaczewski <depesz@depesz.com> write:
That's not what I'm looking for. I want the size limit defined
for the varchar field not the max size the database system can
handle, e.g. if the field is varchar(4) I want the 4.
On Sun, Jul 20, 2008 at 05:50:30PM -0500, Martin wrote:
Ok, this should be simple. How do I find the defined maximum
length of a varchar field?
SELECT
character_maximum_length
FROM
information_schema.columns
WHERE
table_schema = 'name_of_your_schema' and
table_name = 'name_of_your_table' and
column_name = 'name_of_your_column'
bye...
Ludwig
Import Notes
Resolved by subject fallback
Hello
I am using libpq to find information about fileds of table ( type and size).
I have a problem with getting the sizeof varchar fields.
If a table has a fiels varchar[35] and want to obtain 35.
I used PQgetlength or PQfsize but is not good for my work.
Can someone tell me what function shall I use to get the size of filed ?
Thank you
Alin
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Field-size-tp1878962p5720047.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
Hey aliosa
2012/8/16 aliosa <constantinica_alin@yahoo.com>
Hello
I am using libpq to find information about fileds of table ( type and
size).
I have a problem with getting the sizeof varchar fields.
If a table has a fiels varchar[35] and want to obtain 35.
I used PQgetlength or PQfsize but is not good for my work.
Can someone tell me what function shall I use to get the size of filed ?
You should use PQfmod().
--
// Dmitriy.