Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4D17D4760B0 for ; Wed, 16 Oct 2002 05:33:32 -0400 (EDT) Received: from sina.com (unknown [202.106.187.156]) by postgresql.org (Postfix) with SMTP id B6166476043 for ; Wed, 16 Oct 2002 05:33:28 -0400 (EDT) Received: (qmail 85045 invoked from network); 16 Oct 2002 09:24:05 -0000 Received: from unknown (HELO gcgeng) (61.152.125.82) by 202.106.187.156 with SMTP; 16 Oct 2002 09:24:05 -0000 From: "John Geng" To: pgsql-sql@postgresql.org Subject: X-mailer: Foxmail 4.2 [cn] Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=====002_Dragon626680144047_=====" Date: Wed, 16 Oct 2002 17:31:18 +0800 Message-Id: <20021016093329.B6166476043@postgresql.org> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/220 X-Sequence-Number: 9937 This is a multi-part message in MIME format. --=====002_Dragon626680144047_===== Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit how to migrate sql from MS sql server to postgresql? i'd like to tranfer sql schema from MS server Example: *******************1********************************* if exists (select * from sysobjects where id = object_id(N'[admin].[test]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [admin].[test] go *******************2********************************* CREATE TABLE [admin].[test] ( [test_name] [char] (50) NOT NULL , [test_value] [int] NOT NULL ) i can only realize part 2. i don't know how to realize part 1.in other words, i want to know how to check if a table exist in postgresql *******************2********************************* create table test( test_name char (50) not null, test_value int not null ) thanks for any advice!! --=====002_Dragon626680144047_===== Content-Type: text/html; charset="GB2312" Content-Transfer-Encoding: 7bit

how to migrate sql from MS sql server to postgresql?


i'd like to tranfer sql schema from MS server
Example:
*******************1*********************************
if exists (select * from sysobjects
where id = object_id(N'[admin].[test]') and
OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [admin].[test]
go
*******************2*********************************
CREATE TABLE [admin].[test] (
[test_name] [char] (50) NOT NULL ,
[test_value] [int] NOT NULL
)

   i can only realize part 2. i don't know how to realize part 1.in other words,
i want to know how to check if a table exist in postgresql
*******************2*********************************
  create table test(
   test_name char (50) not null,
   test_value int not null
  )

thanks for any advice!!

--=====002_Dragon626680144047_=====--