Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2E9CD2E2F2F for ; Fri, 25 Jan 2008 10:09:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 24329-01 for ; Fri, 25 Jan 2008 10:09:26 -0400 (AST) Received: from tomts4-srv.bellnexxia.net (tomts4.bellnexxia.net [209.226.175.10]) by postgresql.org (Postfix) with ESMTP id 3A2192E2D99 for ; Fri, 25 Jan 2008 10:09:33 -0400 (AST) Received: from T60 ([70.52.248.103]) by tomts4-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20080125140932.DEWQ9176.tomts4-srv.bellnexxia.net@T60> for ; Fri, 25 Jan 2008 09:09:32 -0500 Message-ID: <003301c85f5b$e891c8b0$640fa8c0@T60> From: "Mike Gagnon" To: Subject: CREATE TABLE IF NOT EXIST Date: Fri, 25 Jan 2008 09:09:28 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0030_01C85F31.FD013490" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 x-mimeole: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.079 tagged_above=0 required=5 tests=BAYES_50=0.001, HTML_MESSAGE=0.001, SUBJ_ALL_CAPS=2.077 X-Spam-Level: ** X-Archive-Number: 200801/34 X-Sequence-Number: 9341 This is a multi-part message in MIME format. ------=_NextPart_000_0030_01C85F31.FD013490 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Postgres Experts, I'm trying to create tables (if they don't exist) through the ODBC = driver. I've tried the following: SELECT relname FROM pg_class WHERE relname =3D 'mytable'; This works from the psql command line program when logged into my = database, but not when connected to my database over ODBC ( I get = SQL_NO_DATA back from SQLFetch) Any ideas? Are there other ways to find out if a table exists? Many thanks, Mike ------=_NextPart_000_0030_01C85F31.FD013490 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Postgres Experts,
 
I'm trying to create tables (if they = don't exist)=20 through the ODBC driver.  I've tried the following:
 
SELECT relname FROM pg_class  WHERE relname =3D = 'mytable';
 
This works from the psql command line = program when=20 logged into my database, but not when connected to my database over ODBC = ( I get=20 SQL_NO_DATA back from SQLFetch)
 
Any ideas?  Are there other ways = to find out=20 if a table exists?
 
Many thanks,
Mike
------=_NextPart_000_0030_01C85F31.FD013490--