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

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: byronn(at)insightdist(dot)com (Byron Nikolaidis)
Cc: hannu(at)trust(dot)ee, daveh(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-24 04:05:30
Message-ID: 199804240405.AAA25030@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

>
>
>
> Bruce Momjian wrote:
>
> > > The problem with that theory is this. If the frontend application just
> > > executes some random query, such as "select * from table", you really do not
> > > know anything about what is coming back. You must rely on the little bit of
> > > information the protocol gives you. In the case of Postgres, it gives you
> > > the fieldname, datatype, and size for each column in the result.
> > > Unfortunately, for varchar and char(n), the size reports -1. This is not
> > > very helpful for describing the result set.
> > >
> > > Your above example works fine (in fact we use that already) when you know the
> > > table and column name, as in metadata functions such as SQLColumns() in the
> > > ODBC driver.
> >
> > Yep. We could pass back atttypmod as part of the PGresult. I can add
> > that to the TODO list. Would that help?
>
> Yes, that would do it!
>
> Thank you for listening to our ravings on this issue.

Added to TODO:

* Add pg_attribute.atttypmod/Resdom->restypmod to PGresult structure

This is a good suggestion.

--
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 Vadim B. Mikheev 1998-04-24 06:40:08 Re: [HACKERS] AIX needs a new port maintainer.
Previous Message Byron Nikolaidis 1998-04-24 03:35:40 Re: ODBC + Delphi (GREAT!) + some little thing//

Browse pgsql-interfaces by date

  From Date Subject
Next Message Julia A.Case 1998-04-24 08:40:33 Re: [INTERFACES] Access'97 and ODBC
Previous Message Byron Nikolaidis 1998-04-24 03:35:40 Re: ODBC + Delphi (GREAT!) + some little thing//