Re: regclass without error?

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: regclass without error?
Дата
Msg-id 20100904.084351.115964270.t-ishii@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: regclass without error?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: regclass without error?  (Tatsuo Ishii <ishii@postgresql.org>)
Список pgsql-hackers
> Tatsuo Ishii <ishii@postgresql.org> writes:
> > Is there any way to use regclass without having ERROR?
> 
> > pgpool-II needs to find the oid from table name and for the purpose it
> > issues something like "SELECT 'table_name'::regproc::oid". Problem is,
> > if the table does not exist, an error occured and the transaction
> > aborts. Ideally if the table does not exist, the SELECT returns 0
> > (InvalidOid).
> 
> I don't think the cast should act that way, but I could see providing a
> separate conversion function that returns 0 ... or perhaps better NULL
> ... if no match.

Such a function should be very helpfull. Great!
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: lexing small ints as int2
Следующее
От: Robert Haas
Дата:
Сообщение: Re: ps buffer is incorrectly padded on the (latest) OS X