Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8EJJi765017 for ; Fri, 14 Sep 2001 15:19:44 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f8EIwUn55139 for pgsql-sql@postgresql.org; Fri, 14 Sep 2001 14:58:30 -0400 (EDT) (envelope-from news) Reply-To: "Julester" From: "Julester" X-Newsgroups: comp.databases.postgresql.sql Subject: Checking for table existence Lines: 14 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Message-ID: Date: Fri, 14 Sep 2001 18:58:29 GMT Organization: Optimum Online To: pgsql-sql@postgresql.org X-Archive-Number: 200109/106 X-Sequence-Number: 4771 Hi everyone. In my old SQL Server days, I used a command such as "IF exists(select name from sys_objects where name = 'xyztable')" to check if a table existed before creating it with a standard CREATE command. I looked in the PostgreSQL documentation, but for the life of me, I can't find an equivalent. I can view if the table exists by doing a select against the meta-data tables, but what about the IF statement ? Any help would be greatly appreciated. Thanks. Julester