pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: determine if a table exists
2+ messages / 2 participants
[nested] [flat]

* determine if a table exists
@ 2002-08-01 22:08 Joseph Syjuco <joseph@asti.dost.gov.ph>
  1970-01-01 00:00 ` Re: determine if a table exists Christoph Haller <ch@rodos.fzk.de>
  0 siblings, 1 reply; 2+ messages in thread

From: Joseph Syjuco @ 2002-08-01 22:08 UTC (permalink / raw)
  To: pgsql-sql

how do i determine if a table exists using select statement
i want to find out if it exists if not ill create it if yes then ill do
some editing with it
TIA






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: determine if a table exists
  2002-08-01 22:08 determine if a table exists Joseph Syjuco <joseph@asti.dost.gov.ph>
@ 1970-01-01 00:00 ` Christoph Haller <ch@rodos.fzk.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Christoph Haller @ 1970-01-01 00:00 UTC (permalink / raw)
  To: joseph@asti.dost.gov.ph; +Cc: pgsql-sql

> 
> how do i determine if a table exists using select statement
> i want to find out if it exists if not ill create it if yes then ill do
> some editing with it
> TIA
> 
do 
SELECT relname FROM pg_class
        WHERE relkind='r'
        AND relname !~ '^pg_'
        AND relname !~ '^pga_'
        AND relname !~ '^pgadmin_';

You should also refer to Chapter 3. System Catalogs 
in the Documentation. 

Regards, Christoph 



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-08-01 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-01 22:08 determine if a table exists Joseph Syjuco <joseph@asti.dost.gov.ph>
1970-01-01 00:00 ` Christoph Haller <ch@rodos.fzk.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox