Re: PL/pgSQL 'i = i + 1' Syntax - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: PL/pgSQL 'i = i + 1' Syntax
Date
Msg-id 1148065050.3833.4.camel@localhost.localdomain
Whole thread Raw
In response to Re: PL/pgSQL 'i = i + 1' Syntax  ("Jim C. Nasby" <jnasby@pervasive.com>)
Responses Re: PL/pgSQL 'i = i + 1' Syntax  ("Jim C. Nasby" <jnasby@pervasive.com>)
List 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.



pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: [OT] MySQL is bad, but THIS bad?
Next
From: Hannu Krosing
Date:
Subject: Re: Compression and on-disk sorting