Re: regclass without error?

From: Pavel Golub <pavel(at)microolap(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: regclass without error?
Date: 2010-09-03 14:30:19
Message-ID: 1493540644.20100903173019@gf.microolap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, guys.

You wrote:

TI> Hi,

TI> Is there any way to use regclass without having ERROR?

TI> pgpool-II needs to find the oid from table name and for the purpose it
TI> issues something like "SELECT 'table_name'::regproc::oid". Problem is,
TI> if the table does not exist, an error occured and the transaction
TI> aborts. Ideally if the table does not exist, the SELECT returns 0
TI> (InvalidOid).

Agreed with Tatsuo about having InvalidOid.

TI> Any idea?
TI> --
TI> Tatsuo Ishii
TI> SRA OSS, Inc. Japan
TI> English: http://www.sraoss.co.jp/index_en.php
TI> Japanese: http://www.sraoss.co.jp

--
With best wishes,
Pavel mailto:pavel(at)gf(dot)microolap(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-09-03 14:31:29 Re: regclass without error?
Previous Message David Fetter 2010-09-03 14:21:00 Re: regclass without error?