Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 10E20476085 for ; Wed, 16 Oct 2002 05:11:31 -0400 (EDT) Received: from sina.com (unknown [202.106.187.143]) by postgresql.org (Postfix) with SMTP id D2625475BF9 for ; Wed, 16 Oct 2002 05:11:28 -0400 (EDT) Received: (qmail 38715 invoked by alias); 16 Oct 2002 09:05:48 -0000 Received: from unknown (HELO gcgeng) (61.152.125.82) by 202.106.187.143 with SMTP; 16 Oct 2002 09:05:48 -0000 From: "John Geng" To: pgsql-sql@postgresql.org Subject: help! X-mailer: Foxmail 4.2 [cn] Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=====002_Dragon601016260272_=====" Date: Wed, 16 Oct 2002 17:15:19 +0800 Message-Id: <20021016091128.D2625475BF9@postgresql.org> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/229 X-Sequence-Number: 9946 This is a multi-part message in MIME format. --=====002_Dragon601016260272_===== 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_Dragon601016260272_===== 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_Dragon601016260272_=====--