Re: How to use record variable with non-null domain in plpgsql
От | Tom Lane |
---|---|
Тема | Re: How to use record variable with non-null domain in plpgsql |
Дата | |
Msg-id | 17664.1440258228@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | How to use record variable with non-null domain in plpgsql ("Andrus" <kobruleht2@hot.ee>) |
Ответы |
Re: How to use record variable with non-null domain in plpgsql
How to speed up delete where not in |
Список | pgsql-general |
"Andrus" <kobruleht2@hot.ee> writes: > I'm looging for a way to use tebool type records in plpgsql method starting from Postgres 9.1 > I tried code below but got error > domain tebool does not allow null values > Domain tebool default value is false so plpgsql must assing false to it and should not throw error. > How to fix this so that such record variable can created ? TBH, the problem here is with the not-null constraint on the domain. Get rid of that and you'll be much happier. Data types that try to insist on not being NULL are fundamentally incompatible with SQL semantics --- to take one example, what do you think will happen to a column of such a type when it's on the outside of a LEFT JOIN? It's reasonable to assign NOT NULL requirements to individual table columns, but not to think of it as being a property of a data type. Or another way to put it: NULL in SQL is a type-independent concept. Individual data types simply don't get to opt out of that without creating more problems than they solve. regards, tom lane
В списке pgsql-general по дате отправления: