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

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: daveh(at)insightdist(dot)com (David Hartwig)
Cc: 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:09:40
Message-ID: 199804232109.RAA08650@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

> > 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(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

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-04-23 21:16:36 Re: [HACKERS] Re: [INTERFACES] retrieving varchar size
Previous Message Hannu Krosing 1998-04-23 20:26:25 Re: [HACKERS] Re: [INTERFACES] retrieving varchar size

Browse pgsql-interfaces by date

  From Date Subject
Next Message Bruce Momjian 1998-04-23 21:16:36 Re: [HACKERS] Re: [INTERFACES] retrieving varchar size
Previous Message Hannu Krosing 1998-04-23 20:26:25 Re: [HACKERS] Re: [INTERFACES] retrieving varchar size