Find out if a parameter/return field is NULLABLE using Describe

Поиск
Список
Период
Сортировка
От Richard Jones
Тема Find out if a parameter/return field is NULLABLE using Describe
Дата
Msg-id 20060130203822.GA16111@furbychan.cocan.org
обсуждение исходный текст
Ответы Re: Find out if a parameter/return field is NULLABLE using Describe  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-interfaces
It doesn't seem to be possible to find out if a parameter or result
field is nullable using the Describe protocol.

For example if I have this table and statement:
 create table employees (   id serial not null primary key,   name text not null,   email text
 <-- this field );
 
 insert into employees (name, email) values ($1, $2);

Then the only information I get back about $2 is that it's a TEXT (OID
= 25), when clearly $1 and $2 are different in that one is nullable
and the other isn't.

Similarly,
 select name, email from employees;

This time I get more information about the types, including a modifier
and length, but I can't see whether that lets me find out that one
could be NULL and the other can never be.

So is this possible?

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PL/Java for Debian Etch AMD64 / PostgreSQL 8.1?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Find out if a parameter/return field is NULLABLE using Describe