Re: PL/pgSQL 'i = i + 1' Syntax

From: Hannu Krosing <hannu(at)skype(dot)net>
To: Albe Laurenz <all(at)adv(dot)magwien(dot)gv(dot)at>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PL/pgSQL 'i = i + 1' Syntax
Date: 2006-05-18 09:22:34
Message-ID: 1147944154.3831.11.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ühel kenal päeval, N, 2006-05-18 kell 09:28, kirjutas Albe Laurenz:
> Josh Berkus wrote:
> >> If you only care about Oracle to PostgreSQL (and who wouldn't?), then
> >> it in fact seems desirable for PL/pgSQL to be a superset of PL/SQL.
> >
> > I agree with David here. We care about the ability to migrate PL/SQL -->
> > PL/pgSQL. We do *not* care about the ability to migrate PL/pgSQL -->
> > PL/SQL. So supporting extra syntax which Oracle doesn't ... as long as
> > the Oracle syntax still works ... is in fact a good thing.
>
> I cannot feel good about deliberately introducing incompatibilities.

I guess that PL/pgSQL will always be "an extended subset" of PL/SQL, and
never be direct replacement, so I dont see another extension as
introducing incompatibilities.

> If assignment by '=' gets documented and known, it will get used.
> This in turn will make PL/pgSQL less familiar for PL/SQL coders.
> And that will make them more reluctant to change over.

Someone else using = instead of := is the least of their worries when
switching to PostgreSQL (and you cant switch to PL/pgSQL without
switching to PostgreSQL).

PostgreSQL generally behaves differently on much deeper levels,
sometimes better sometimes worse. And you need to optimise code in
different ways, as much of oracles deep secrets are not applicable to
pg.

> I think it would be best to get a compile error when '=' is used for
> assignment, but if that's too much effort, I believe that the current
> behaviour is acceptable as long as it doesn't get documented and
> 'good practice'.

What does PL/SQL use for assignment inside UPDATE statements ?

Is it "SET A=B" like in SQL or "SET A:=B" like in rest of PL/SQL ?

--
----------------
Hannu Krosing
Database Architect
Skype Technologies OÜ
Akadeemia tee 21 F, Tallinn, 12618, Estonia

Skype me: callto:hkrosing
Get Skype for free: http://www.skype.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dhanaraj M 2006-05-18 09:29:53 Re: Clarification required
Previous Message Simon Riggs 2006-05-18 09:01:17 Re: does wal archiving block the current client connection?