From: José Soares <jose@sferacarta.com>
To: Brett W. McCoy <bmccoy@lan2wan.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] Detecting existance of table
Date: Thu, 22 Apr 1999 14:02:09 +0200
Message-ID: <371F0FC1.DF690C47@sferacarta.com> (raw)
References: <Pine.BSI.3.91.990421184714.10411U-100000@access1.lan2wan.com>
Try this:
select TRUE from pg_class where relname = 'my_table' and relkind = 'r';
José
"Brett W. McCoy" ha scritto:
> Is there a way of detecting the existance of a table via a function call?
> I'm trying to implement a 'saved search' feature in a search engine, and
> need to query a database to see if a particular table exists without
> throwing an error. Actually, can an exception be caught somehow? I'm
> mainly doing this with PHP3, but I also need to do it via the Perl Pg.pm
>
> Brett W. McCoy
> http://www.lan2wan.com/~bmccoy
> -----------------------------------------------------------------------
> Why is the alphabet in that order? Is it because of that song?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: jose@sferacarta.com, bmccoy@lan2wan.com
Subject: Re: [INTERFACES] Detecting existance of table
In-Reply-To: <371F0FC1.DF690C47@sferacarta.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox