Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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?

    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.


In response to

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group