> > The information you want is in pg_attribute.atttypmod. It is normally
> > -1, but is set for char() and varchar() fields, and includes the 4-byte
> > length. See bin/psql/psql.c for a sample of its use.
>
> I see everyone writing in terms of length. You do mean precision, don't
> you? For our purposes, this precision should arrive in the result
> header. (redundancy in each tuple could be over looked) The goal is to be
> able to put realistic bounds on memory allocation before the entire result is
> read in. For this to work, functions must also be able to propagate the
> their precision.
>
> Did I spell doom to this idea?
Hmm. The problem is that many of us use the old 'text' type, which
doesn't have a defined length. Not sure how to handle this in a
portable libpq way?
--
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)