Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable - Mailing list pgsql-hackers

From Alex Goncharov
Subject Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable
Date
Msg-id E1RByaN-000DPv-M4@hanssachs.home
Whole thread Raw
In response to Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable  (Andres Freund <andres@anarazel.de>)
Responses Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable  ("anarazel@anarazel.de" <andres@anarazel.de>)
List 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@comcast.net --



pgsql-hackers by date:

Previous
From: Alex Goncharov
Date:
Subject: Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable
Next
From: "anarazel@anarazel.de"
Date:
Subject: Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable