Re: [HACKERS] Re: [INTERFACES] retrieving varchar size - Mailing list pgsql-interfaces

From Bruce Momjian
Subject Re: [HACKERS] Re: [INTERFACES] retrieving varchar size
Date
Msg-id 199804232117.RAA11218@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Re: [INTERFACES] retrieving varchar size  (Hannu Krosing <hannu@trust.ee>)
List 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@candle.pha.pa.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)

pgsql-interfaces by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: [INTERFACES] retrieving varchar size
Next
From: "Michael Moss"
Date:
Subject: Re: [INTERFACES] Can't connect with ODBC