Re: Porting MSSQL to PGSQL (Was: [OT] MySQL is bad, but THIS bad?) - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Re: Porting MSSQL to PGSQL (Was: [OT] MySQL is bad, but THIS bad?)
Date
Msg-id 20060522150237.GL64371@pervasive.com
Whole thread Raw
In response to Re: Porting MSSQL to PGSQL (Was: [OT] MySQL is bad, but THIS bad?)  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Porting MSSQL to PGSQL (Was: [OT] MySQL is bad, but
List pgsql-hackers
On Sun, May 21, 2006 at 02:58:17PM -0700, Josh Berkus wrote:
> Mischa,
> 
> > Somebody earlier was mentioning, why no automatic transformer from
> > Transact-SQL to PLPGSQL (maybe with a bunch of glue routines). The grammar
> > is not a problem, though you have to wonder at all the wired-in keywords
> > (T-SQL always felt like COBOL).
> 
> Actually, porting TSQL to PL/pgSQL would be very hard.   I speak as an expert 
> TSQL developer.  For example, most data manipulation in TSQL is done through 
> updatable cursors, something we don't currently support.  Also, T-SQL uses 
> un-ordered, callable parameters for SPs, something which we *also* don't 
> support.

And TSQL doesn't fail a transaction on an error, resulting in code like

UPDATE ...

if @@error = 0 then   UPDATE ...
end
if @@error = 0 then
...

Makes for a lot of needless bloat when going to PostgreSQL. Supposedly
this is changed in MSSQL05 though.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Porting MSSQL to PGSQL (Was: [OT] MySQL is bad, but THIS bad?)
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Porting MSSQL to PGSQL (Was: [OT] MySQL is bad, but THIS bad?)