From: Reinoud van Leeuwen <reinoud.v@n.leeuwen.net>
To: pgsql-sql@postgresql.org
Subject: Re: stored procedures: sybase -> postgreSQL ?
Date: Mon, 09 Sep 2002 23:02:27 +0200
Message-ID: <np2qnu4ti7kq0uadqd38o87pm0c1snrspb@4ax.com> (raw)
References: <1031595353.774.55.camel@pandorina.biology.duke.edu>
On Mon, 9 Sep 2002 18:16:07 +0000 (UTC), chauser@duke.edu (Charles
Hauser) wrote:
>I am trying to port a Sybase table create script to one usable for
>postgreSQL.
>
>(note I am not a DBA)
>
>In particular I am not well versed on how to use/recode the stored
>procedures such as that in the example below.
>
>ALTER TABLE DnaFragment
> ADD PRIMARY KEY (dna_fragment_id)
>go
>
> exec sp_primarykey DnaFragment,
> dna_fragment_id
>go
>
> exec sp_bindrule DnaFragment_type_rule, 'DnaFragment.type'
> exec sp_bindefault Set_To_Current_Date,
>'DnaFragment.date_last_modified'
> exec sp_bindefault Set_to_False, 'DnaFragment.is_obsolete'
>go
Postgresql and Sybase are a lot different in many ways. Lot of the
Postgresql is clearly borrowed from oracle ways of thinking (mind that
this is not neccessary better or worse, it is different).
When using standard SQL, the differences are not really much.
Postgresql uses that ANSI outer join syntax instead of the Sybase =*
notation.
But when you start using Sybase specific features the differences will
become more clean. Rules and defaults are not defined as seperate
entities, so you have to define them inside the table definitions. The
alter table statement is by the way explained on
http://www.postgresql.org/idocs/index.php?sql-altertable.html.
If you want to convert one database definition to another, you might
want to use a tool like Sybase Powerdesigner. You can read the Sybase
definition, and create a Postgresql definition from there. An
evaluation version (fully functional for a limited time) is
downloadable from the Sybase website
--
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen reinoud.v@n.leeuwen.net
http://www.xs4all.nl/~reinoud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: reinoud.v@n.leeuwen.net
Subject: Re: stored procedures: sybase -> postgreSQL ?
In-Reply-To: <np2qnu4ti7kq0uadqd38o87pm0c1snrspb@4ax.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox