Re: Selecting a constant question

From: "Dann Corbit" <DCorbit(at)connx(dot)com>
To: "Hannu Krosing" <hannu(at)skype(dot)net>, "Larry McGhaw" <lmcghaw(at)connx(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Gregory Stark" <stark(at)enterprisedb(dot)com>, "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, <pgsql-hackers(at)postgresql(dot)org>, <mysql(at)lists(dot)mysql(dot)com>
Subject: Re: Selecting a constant question
Date: 2007-06-12 05:55:44
Message-ID: D425483C2C5C9F49B5B7A41F8944154701000727@postal.corporate.connx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: Hannu Krosing [mailto:hannu(at)skype(dot)net]
> Sent: Monday, June 11, 2007 10:43 PM
> To: Larry McGhaw
> Cc: Tom Lane; Alvaro Herrera; Dann Corbit; Gregory Stark; Martijn van
> Oosterhout; pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] Selecting a constant question
>
> Ühel kenal päeval, E, 2007-06-11 kell 22:11, kirjutas Larry McGhaw:
> > As far as I am aware these statements are true. If you have a
> > specific example you could provide to the contrary that would be
> > interesting.
> >
> > Even if there are such conditions it does not change the fact that
> > libpq and/or postgresql is deficient in this area.
> >
> > For any query, the database should be capable of describing the
> > metadata for the columns, which includes
> > 1) the column type
> > and
> > 2) the column maximum length.
> >
> > This is such a basic database interface principle that I very
> > disappointed that someone has not recognized this and simply said "
> > yes, we see the issue we will work on it".
> >
> > Again, *all* other major relational databases do this ... even blob
> > fields have a maximum length reported from the database.
> >
> > I hope someone who truly understands database interfaces will read
> > this thread and address the issue.
> > For now we will have to "special case" postgres in our application
> > until it is addressed.
> >
>
> or redesign your application so that it allocates memory as needed and
> won't waste client memory by allocating maximum possible amount for each
> and every grid cell weather needed or not ;)
>
> As I understand from this discussion you are writing some kind of
> middleware (i.e. tools), and I'd expect toolmakers to do the right
> thing.

In this case the middleware is:
ODBC/JDBC/OLEDB/.NET data drivers for PostgreSQL.

There are other related tools, but the above is the product for which the bug needs corrected.


> allocating as much as possibly ever needed is something that would be
> excusable in quick-n-dirty end user application, but not in a tool.

It's a requirement of the ODBC/JDBC/OLEDB/.NET specifications. I suppose we could scan the table twice to figure out how large a column might be, but that would make the PostgreSQL driver run at 1/2 speed. Not a very appetizing solution.

None of the other database vendors has any trouble reporting this information correctly.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2007-06-12 06:46:17 Re: Selecting a constant question
Previous Message Dann Corbit 2007-06-12 05:44:48 Re: Selecting a constant question