Re: NOT NULL with CREATE TYPE

From: Jean Hoderd <jhoderd(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: NOT NULL with CREATE TYPE
Date: 2009-06-05 17:58:09
Message-ID: 885024.81977.qm@web30404.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi,

> So I don't recommend you try to do this. What is the actual problem
> you are trying to solve? Why do you want the client library to be
> concerned with attnotnull at all?

In general the client library needs to check attnotnull to make sure
that the client is not making a type mistake. If for example a field
is "int null", but the client program treats it as "int not null" (ie,
forgetting to check for the null case), then the client program is
wrong and the compiler should issue a warning. This is basic, essential,
functionality. But I'm curious: how else could this be done?...

> ... or even more to the point, why do you think the above is a good
> idea to begin with? It looks more like the kind of bad design that
> is frequently committed by people who basically don't like SQL, and
> try to ensure that no one else will like it either.

The above example was absurdly simple, but in the real world the query
is complex enough that instead of being just a SELECT is actually the
return of a PL/PGSQL function. I just want a way to tell the client
which fields from the return type are actually, really, nullable...

Any other ideas?

Cheers,
Jean

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Schwarzenbach 2009-06-05 18:05:36 Re: Schema, database, or tables in different folders?
Previous Message S Arvind 2009-06-05 17:53:25 Re: max execution time of query