Re: Dumb question: How do I determine programmatically if a column is nullable?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Dumb question: How do I determine programmatically if a column is nullable?
Дата
Msg-id 3816.1073540510@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Dumb question: How do I determine programmatically if a column is nullable?  ("Dann Corbit" <DCorbit@connx.com>)
Список pgsql-hackers
"Dann Corbit" <DCorbit@connx.com> writes:
> In other words, I will be passed a SQL query.  I don't want to have to
> parse it myself.
> Rather, I want to know (for the bound columns) if a column is nullable
> or not.
> Is the functionality available in [for example] libpq?

As of 7.4, see PQftable() and PQftablecol(), and look into pg_attribute
to see whether the column is marked NOTNULL.
        regards, tom lane


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

Предыдущее
От: "Dann Corbit"
Дата:
Сообщение: Re: Dumb question: How do I determine programmatically if a column is nullable?
Следующее
От: Stephen Frost
Дата:
Сообщение: Segfault in 7.4.1 (and 7.3.4) during vacuum analyze