Re: [HACKERS] Re: [INTERFACES] retrieving varchar size

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: hannu(at)trust(dot)ee (Hannu Krosing)
Cc: daveh(at)insightdist(dot)com, hannu(at)trust(dot)ee, byronn(at)insightdist(dot)com, pgsql-hackers(at)postgreSQL(dot)org, pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: [INTERFACES] retrieving varchar size
Date: 1998-04-23 21:16:36
Message-ID: 199804232117.RAA11218@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

> is this on client side or server side?
>
> Last time I checked (it was in 6.2 protocol) it was not sent to client.
>
> What I need is the defined max length of varchar (or char), not just
> actual length of each field of that type. This is used by Borlands BDE,
> and if this changes, depending on the where clause, it breaks BDE.

Can't you do:

select atttypmod from pg_attribute
where attrelid = 10003 and attname = 'col1';

That will give the length + 4 bytes.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Darren King 1998-04-23 22:31:36 AIX needs a new port maintainer.
Previous Message Bruce Momjian 1998-04-23 21:09:40 Re: [HACKERS] Re: [INTERFACES] retrieving varchar size

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Moss 1998-04-24 00:14:38 Re: [INTERFACES] Can't connect with ODBC
Previous Message Bruce Momjian 1998-04-23 21:09:40 Re: [HACKERS] Re: [INTERFACES] retrieving varchar size