Re: Proposed ProcessUtility() API additions
| От | Gregory Stark |
|---|---|
| Тема | Re: Proposed ProcessUtility() API additions |
| Дата | |
| Msg-id | 87d53k8sqa.fsf@stark.xeocode.com обсуждение исходный текст |
| Ответ на | Proposed ProcessUtility() API additions (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: Proposed ProcessUtility() API additions
|
| Список | pgsql-hackers |
"Tom Lane" <tgl@sss.pgh.pa.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
В списке pgsql-hackers по дате отправления: