Friday, July 25, 2008

Re: [SQL] Test if a table is present

On Sat, 26 Jul 2008, "Ole Ekerhovd" <olehare@online.no> writes:
> How can I test if a table is present in database?

SELECT TRUE
FROM information_schema.tables
WHERE table_name = '<TABLE>' AND
table_schema = '<SCHEMA>'

BTW, this query is portable across database systems supporting
information schema, which is an almost defacto standard.


Regards.

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

No comments: