Re: Cannot declare record members NOT NULL

From: Cultural Sublimation <cultural_sublimation(at)yahoo(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Cannot declare record members NOT NULL
Date: 2007-09-13 12:06:40
Message-ID: 71481.83145.qm@web63403.mail.re1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

> The thing behind the RETURNS in a function is always a data type,
> regardless if it is one that has been explicitly declared with
> CREATE TYPE or implicitly by CREATE TABLE.
>
> There are no NOT NULL conditions for data types.
>
> NOT NULL only exists for table columns.

Thanks for the informative reply. As I mentioned in the message
to Tom, I think I understand the source of the problem. In SQL,
type constraints are not seen as creating different types, whereas
in OCaml they do. (I still maintain that OCaml's way of doing
things is more correct on a fundamental level, though).

> Have you considered an ON SELECT ... DO INSTEAD rule?
> http://www.postgresql.org/docs/current/static/rules.html
>
> You could create a table that represents the query and
> define a SELECT rule on it.

Thanks, I'll investigate that...

Regards,
C.S.


____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stefan Schwarzer 2007-09-13 12:16:03 Re: Database/Table Design for Global Country Statistics
Previous Message Cultural Sublimation 2007-09-13 12:02:10 Re: Cannot declare record members NOT NULL