Re: [pgadmin-support] hi

From: "Hepworth, Mike" <mike(dot)hepworth(at)pbs(dot)proquest(dot)com>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [pgadmin-support] hi
Date: 2002-10-17 18:20:06
Message-ID: 560796A29B821F40A277973FB5EA3004034AC9@slexc1a.server.power.bellhow.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

lz,

You could use the plpgsql function language and create a function that tests
for the existence of the file and drop it if it does.

Something like this:

select dropTableIfExists('test');

The dropTableIfExists would be the plpgsql function that you would need to
write.

Later,

Mike Hepworth......

-----Original Message-----
From: lz John [mailto:oceanlz(at)yahoo(dot)com(dot)cn]
Sent: Thursday, October 17, 2002 1:07 AM
To: pgsql-sql-owner(at)postgresql(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: [pgadmin-support] hi

i don't send mail to pgsql-sql(at)postgresql(dot)org
<mailto:pgsql-sql(at)postgresql(dot)org> ,but i need help

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!!

_____

Do You Yahoo!?
"发短信赢手机,快来参加雅虎巨星秀!"
<http://rd.yahoo.com/mail_cn/tag/?http://cn.ent.yahoo.com/star/midautumn/ind
ex.html>

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2002-10-17 18:42:50 Re: object oriented vs relational DB
Previous Message Josh Berkus 2002-10-17 18:13:08 Re: [SQL] isAutoIncrement and Postgres