Re: [HACKERS] Re: [INTERFACES] retrieving varchar size
От | Bruce Momjian |
---|---|
Тема | Re: [HACKERS] Re: [INTERFACES] retrieving varchar size |
Дата | |
Msg-id | 199804232109.RAA08650@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: [HACKERS] Re: [INTERFACES] retrieving varchar size (David Hartwig <daveh@insightdist.com>) |
Список | pgsql-hackers |
> > 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)
В списке pgsql-hackers по дате отправления: