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

From: Hannu Krosing <hannu(at)skype(dot)net>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Douglas McNaught <doug(at)mcnaught(dot)org>, Mark Dilger <pgsql(at)markdilger(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PL/pgSQL 'i = i + 1' Syntax
Date: 2006-05-19 18:57:29
Message-ID: 1148065050.3833.4.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ühel kenal päeval, R, 2006-05-19 kell 11:24, kirjutas Jim C. Nasby:

> Something that's always bugged me is how horribly variables are handled
> in plpgsql, namely that if you have a variable and a field with the same
> name it can be extremely difficult to keep them seperated. Perhaps := vs
> = might be a way to keep it clear as to which is which...

I can't see how := helps here. Once you have fields, you are either in
SQL-land and always use = or have the fields selected into a type or
recors and can use record.field syntax.

> Though, a better way would probably just be to provide a built-in
> construct for referencing plpgsql variables, such as $.

Where is it exactly a problem which can't be solved simply by naming
your variables differently from fields?

--
----------------
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

NOTICE: This communication contains privileged or other confidential
information. If you have received it in error, please advise the sender
by reply email and immediately delete the message and any attachments
without copying or disclosing the contents.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2006-05-19 18:58:02 Re: [HACKERS] [OT] MySQL is bad, but THIS bad?
Previous Message Tom Lane 2006-05-19 18:53:05 Re: Compression and on-disk sorting