Re: NOT NULL with CREATE TYPE

Поиск
Список
Период
Сортировка
От Jean Hoderd
Тема Re: NOT NULL with CREATE TYPE
Дата
Msg-id 885024.81977.qm@web30404.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на NOT NULL with CREATE TYPE  (Jean Hoderd <jhoderd@yahoo.com>)
Ответы Re: NOT NULL with CREATE TYPE  (Jeff Davis <pgsql@j-davis.com>)
Re: NOT NULL with CREATE TYPE  (Merlin Moncure <mmoncure@gmail.com>)
Список 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





В списке pgsql-general по дате отправления:

Предыдущее
От: Eric Schwarzenbach
Дата:
Сообщение: Re: Schema, database, or tables in different folders?
Следующее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: why dropping a trigger may cause a deadlock