Re: Function error

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Sachin Srivastava <ssr(dot)teleatlas(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Function error
Date: 2016-01-14 05:31:33
Message-ID: CAKFQuwY+FwChU7zXB=FXrYjLsa+dvthnFCWf=4OYncKD0XqD=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 13, 2016 at 10:06 PM, Sachin Srivastava <ssr(dot)teleatlas(at)gmail(dot)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.​

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Rowley 2016-01-14 08:56:59 Re: Why PG uses nested-loop join when no indexes are available?
Previous Message Sachin Srivastava 2016-01-14 05:06:25 Re: Function error