Re: Function error - Mailing list pgsql-general

From David G. Johnston
Subject Re: Function error
Date
Msg-id CAKFQuwY+FwChU7zXB=FXrYjLsa+dvthnFCWf=4OYncKD0XqD=w@mail.gmail.com
Whole thread Raw
In response to Re: Function error  (Sachin Srivastava <ssr.teleatlas@gmail.com>)
List pgsql-general
On Wed, Jan 13, 2016 at 10:06 PM, Sachin Srivastava <ssr.teleatlas@gmail.com> wrote:
Dear Albe,

Thanks for your support !!!

In my function the problem is that global variables defined inside the function. These variables are visible to functions defined inside a function.

​Holy Crap...PostgreSQL functions support closures and global variables?  Who knew?  Well, aside from that fact that relations are global, anyway...

The problem you seem to have is trying to do something in PostgreSQL exactly like you'd do it in Oracle.  While I'm sure many things can be ported over you seem to have stumbled upon one of those things that likely will need to be written using PostgreSQL idioms.

​David J.​

pgsql-general by date:

Previous
From: Sachin Srivastava
Date:
Subject: Re: Function error
Next
From: David Rowley
Date:
Subject: Re: Why PG uses nested-loop join when no indexes are available?