Windows DatabaseebooksStatistical Information

LLE10255 : Howto test is a certain table is present in a postgres database

Symptom:

You need to know the presence of a certain database table

Cause:

none

Solution:

To test if a table is present in database you can use the following sql query?

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

This query is portable on database systems supporting the information schema defacto standard.

For more information take a look at the following link:

http://www.postgresql.org/docs/8.3/static/information-schema.html

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!
Copyright © 2004-2011 Lubby (V3.0.10 Aug 2011)
Sponsored by Keskon.
Statistical information by Google Analytics