| From: | Gregory Stark <stark(at)enterprisedb(dot)com> | 
|---|---|
| To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| Cc: | <pgsql-hackers(at)postgreSQL(dot)org> | 
| Subject: | Re: Proposed ProcessUtility() API additions | 
| Date: | 2007-03-08 00:49:17 | 
| Message-ID: | 87d53k8sqa.fsf@stark.xeocode.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> * is_top_level: TRUE if command is being driven directly from
>   exec_simple_query or exec_execute_message, else FALSE (this would
>   need to be passed through PortalRun, so it gets this parameter added
>   too).
...
> The point of adding is_top_level is to provide a simpler, more reliable
> means for PreventTransactionChain and related functions to detect
> whether a function is trying to invoke a non-transaction-block-safe
> command.  Currently we rely on an ugly test involving seeing if the
> statement node is in the QueryContext, but that's always been a kluge,
> and I'm not sure that it works 100% even today.  I'd like to get rid
> of the QueryContext global altogether.
I'm not exactly following. How does the exec_simple_query or
exec_execute_message tell you whether you're in a transaction?
Can't you exec_simple_query("BEGIN;") and then exec_simple_query a second
query in the same transaction?
-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Gregory Stark | 2007-03-08 01:01:51 | Re: Grouped Index Tuples / Clustered Indexes | 
| Previous Message | Gregory Stark | 2007-03-08 00:40:16 | Re: [HACKERS] WITH/RECURSIVE plans |