Re: How to know if an INSERT is done inside a function? - Mailing list pgsql-general

From Ricardo Ramírez
Subject Re: How to know if an INSERT is done inside a function?
Date
Msg-id AANLkTilIC3TM0HylpgDZn18OKX8i7alT3pvtZzXDWX4b@mail.gmail.com
Whole thread Raw
In response to Re: How to know if an INSERT is done inside a function?  (Andre Lopes <lopes80andre@gmail.com>)
List pgsql-general
Hi,
look at this page of the documentation of postgres http://www.postgresql.org/docs/current/static/plpgsql-statements.html
there explain some ways to know
the effect of a SQL command.

Regards.

2010/7/4 Andre Lopes <lopes80andre@gmail.com>
Hi,

The function will run in the php-cli, in a CronJob, it is not for use in a PHP webpage. I think doesn't matter the extra time that takes to run.

Best Regards,



On Sun, Jul 4, 2010 at 4:11 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
2010/7/4 Merlin Moncure <mmoncure@gmail.com>:
> On Sun, Jul 4, 2010 at 7:25 AM, Andre Lopes <lopes80andre@gmail.com> wrote:
>> Great! That [begin exception end] is what I need!
>>
>> Thank you Pavel.
>>
>> Best Regards,
>
> Just a quick heads up: functions with exception handlers tend to be
> more expensive than those without, even if the exception doesn't fire.

yes, better to use prepared statement and read diagnostics info from PHP

Pavel

>
> merlin
>


pgsql-general by date:

Previous
From: Andre Lopes
Date:
Subject: Re: How to know if an INSERT is done inside a function?
Next
From: Craig Ringer
Date:
Subject: Re: Extending postgres objects with attributes