Gisel
Gisel

Reputation: 1

Postgres 9.4 - Check if a table exist in database

I would like to know if Postgresql has implemented a function that runs automatically and returns me if a table is created in the database independently of the schema.

version : Postgresql 9.4

Thanks!

Upvotes: 0

Views: 153

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246413

You could query information_schema.tables, but that will only give you information about tables on which you have privileges:

SELECT EXISTS (SELECT 1
               FROM information_schema.tables
               WHERE table_name = 'guppy');

Upvotes: 1

Related Questions