Re: Test if a table is present

From: Volkan YAZICI <yazicivo(at)ttmail(dot)com>
To: "Ole Ekerhovd" <olehare(at)online(dot)no>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Test if a table is present
Date: 2008-07-26 05:48:11
Message-ID: 87bq0li4bo.fsf@alamut.mobiliz.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sat, 26 Jul 2008, "Ole Ekerhovd" <olehare(at)online(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Allan Kamau 2008-07-26 13:17:56 Efficiently determining the number of bits set in the contents of a VARBIT field
Previous Message Anoop G 2008-07-26 05:33:26 Re: Test if a table is present