Re: Moving from Sybase to PostgreSQL - Stored Procedures

From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Moving from Sybase to PostgreSQL - Stored Procedures
Date: 2005-01-29 22:23:15
Message-ID: cth2ch$m5j$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andre Schnoor wrote:
> Hi,
>
> I'm moving from Sybase to pgsql but have problems with stored procedures.
> The typical procedure uses
>
> a) named parameters,
> b) local variable declarations and assignments
> c) transactions
> d) cursors, views, etc.
>
> I can't seem to find these things in the Postgres function syntax.
> Procedures can be as long as 20-250 lines, performing heavy data
> manipulation tasks, running from a few seconds up to several hours. Database
> size is approx. 20GB.
>
> Functions in pgsql are very limited compared to Sybase procedures, so I'll
> have to find a workaround somehow. Perhaps somebody can point me to examples
> or hints regarding this issue.
>
> Thanks in advance!
>
pgsql is not the only language that you can use when writing PosgreSQL
functions. Other languages like Perl and Java will provide a richer
functionality.

PostgreSQL doesn't have stored procedures and its functions will always
run within the transaction that was in effect when the call was issued
so your Sybase stored procedures involving several hours of execution
must probably be rewritten so that you move the transaction demarcation
to a client that issues several more short-lived calls.

Regards,
Thomas Hallgren

In response to

Browse pgsql-general by date

  From Date Subject
Next Message William Yu 2005-01-29 22:36:31 Re: Splitting queries across servers
Previous Message Bruno Wolff III 2005-01-29 22:14:28 Re: Scanning the PGSQL DB