Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable

From: Alex Goncharov <alex-goncharov(at)comcast(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable
Date: 2011-10-07 00:46:47
Message-ID: E1RByaN-000DPv-M4@hanssachs.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

,--- You/Andres (Fri, 7 Oct 2011 02:28:30 +0200) ----*
| > a lot of cases where the database could deduce (quite easily) that a
| > result column cannot be null
| Could you quickly explain what exactly you want that information for? Just
| because it has been done before doesn't necessarily mean its a good idea...

I am not writing a database application here (i.e. I am not storing
the data). I am responding to a client requirement, basically:

Given a SELECT (or possibly, simpler, a table name), tell me which
columns are non-nullable?

I can give the answer about the tables trivially in 'psql' (using
pg_attribute.attnotnull). But it has to be done inside the C code I
wrote a couple of years ago, already using libpq, preparing and
describing arbitrary statements... If I could get the required
information through some use of PQ* functions...

But, oh well, I'll "PQexec(a-fancy-select-from-pg_attribute)".

Ugly :(

-- Alex -- alex-goncharov(at)comcast(dot)net --

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message anarazel@anarazel.de 2011-10-07 00:54:39 Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable
Previous Message Alex Goncharov 2011-10-07 00:34:41 Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable