Re: Cannot declare record members NOT NULL - Mailing list pgsql-general

From Cultural Sublimation
Subject Re: Cannot declare record members NOT NULL
Date
Msg-id 515591.83687.qm@web63410.mail.re1.yahoo.com
Whole thread Raw
In response to Re: Cannot declare record members NOT NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi Tom,

> In any case, it appears to me that your gripe has little to do with
> whether there's actually any enforcement of the not-null condition,
> and much to do with whether some unspecified client-side software
> thinks the query result column is guaranteed not null.  Most likely
> you're going to have to fix the client-side software, because it's
> extrapolating things that Postgres does not tell it.

That's not entirely true.  The client software obtains the type
information by querying Postgresql, namely by checking the attnotnull
column in the pg_attribute catalog.  Therefore, this is not an
inference error on the client side, but instead a case of Postgresql
providing wrong information.

Well, we could argue all day on whether this is a bug or a feature,
but the fact is that it is a huge setback for me.  I wanted my clients
to access the database indirectly, via a function such as get_movies,
but this problem makes that impossible.

I also thought that instead of using a function, I could create a view,
and the clients could use it to access the database.  But there's also
a problem with this solution: as far as I'm aware, views in Postgresql
cannot accept parameters.  While the simple example does not need
parametrized views, the real world app would need them.

So, barring functions and views, is there any other way to encapsulate
the inner workings of a query away from clients?

Thanks again for your help,
C.S.





____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Cannot declare record members NOT NULL
Next
From: Jorge Godoy
Date:
Subject: Re: ON UPDATE trigger question