Thread: Moving from Transact SQL to PL/pgSQL

Moving from Transact SQL to PL/pgSQL

From
"Kevin Duffy"
Date:
Hello:
 
I am starting a project using Postgres.  The requirements are very similar to work I have done in the past using M$-SQL.  Therefore, there are many Transact SQL stored procedures I need to port over to PL/pgSQL.
 
Where would I find documentation on PL/pgSQL, with examples? 
 
How close to Oracle PL-SQL is Postgres?  Would a Oracle PL-SQL book cover the basics?
 
Remember be kind to the newbee.
 
 
Kevin Duffy
 

Re: Moving from Transact SQL to PL/pgSQL

From
Michael Fuhr
Date:
On Mon, Jan 24, 2005 at 12:14:22PM -0500, Kevin Duffy wrote:

> Where would I find documentation on PL/pgSQL, with examples? 

On the PostgreSQL web site, or perhaps on your own server if you've
installed the documentation.

http://www.postgresql.org/

Follow the "Documentation" link, then follow the "Online Manuals"
link for whatever version of PostgreSQL you're running.  The PL/pgSQL
documentation is under "Server Programming."

> How close to Oracle PL-SQL is Postgres?  Would a Oracle PL-SQL book cover the basics?

The PL/pgSQL documentation has a "Porting from Oracle PL/SQL"
section.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


Re: Moving from Transact SQL to PL/pgSQL

From
Dennis Sacks
Date:
Kevin Duffy wrote:
Hello:
 
I am starting a project using Postgres.  The requirements are very similar to work I have done in the past using M$-SQL.  Therefore, there are many Transact SQL stored procedures I need to port over to PL/pgSQL.
 
Where would I find documentation on PL/pgSQL, with examples? 
 
How close to Oracle PL-SQL is Postgres?  Would a Oracle PL-SQL book cover the basics?
 
Oracle PL-SQL and PL/pgSQL seem very similar. There are definitely differences however. Most of what you want to know is included in the PostgreSQL document. I'd recommend reading through the PL/pgSQL chapter several times before you begin.

_PostgreSQL_ by Douglas and Douglas has a chapter on PL/pgSQL. I'm not sure what that chapter is like as I don't own this book. It might be worth looking into.

I don't know of any documents that give hints for porting from TSQL to PL/pgSQL, but then I've not looked for any. They may exist.


Best of luck,

Dennis Sacks
dennis@illusions.com

Re: Moving from Transact SQL to PL/pgSQL

From
"Clint Stotesbery"
Date:
For Oracle info, check out one of my recent posts:
http://archives.postgresql.org/pgsql-sql/2005-01/msg00231.php

For TSQL, well, I was involved in project where we converted an Oracle db 
(with procs, functions, triggers, etc) to PostgreSQL and MS Sql Server. 
plpgsql and plsql are close enough where it isn't too hard to convert 
between the two. TSQL and plpgsql are quite different.
-Clint

----Original Message Follows----
From: "Kevin Duffy" <kevin07@parkerglobal.com>
To: <pgsql-sql@postgresql.org>
Subject: [SQL] Moving from Transact SQL to PL/pgSQL
Date: Mon, 24 Jan 2005 12:14:22 -0500


Hello:

I am starting a project using Postgres.  The requirements are very similar 
to work I have done in the past using M$-SQL.  Therefore, there are many 
Transact SQL stored procedures I need to port over to PL/pgSQL.

Where would I find documentation on PL/pgSQL, with examples?

How close to Oracle PL-SQL is Postgres?  Would a Oracle PL-SQL book cover 
the basics?

Remember be kind to the newbee.


Kevin Duffy