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

From Merlin Moncure
Subject Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable
Date
Msg-id CAHyXU0w7JSfFok7wudD+3heiEbMMHXjeaGHGEeY95-SNRhm+EA@mail.gmail.com
Whole thread Raw
In response to Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable  (Florian Pflug <fgp@phlo.org>)
List pgsql-hackers
On Thu, Oct 6, 2011 at 4:16 PM, Florian Pflug <fgp@phlo.org> wrote:
> Sure, but there are still a lot of cases where the database could deduce
> (quite easily) that a result column cannot be null. Other databases do
> that - for example, I believe to remember that Microsoft SQL Server preserves
> NOT NULL constraints if you do
>
>  CREATE TABLE bar AS SELECT * from foo;
>
> So the question makes perfect sense, and the answer is: No, postgres currently
> doesn't support that, i.e. doesn't deduce the nullability of result columns,
> not even in the simplest cases.

hm, good point.  not sure how it's useful though.  I suppose an
application could leverage that for validation purposes, but that's a
stretch I think.

merlin


pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable
Next
From: Florian Pflug
Date:
Subject: Re: Bug in walsender when calling out to do_pg_stop_backup (and others?)