Re: any way for a transaction to "see" inserts done earlier in the transaction?

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: any way for a transaction to "see" inserts done earlier in the transaction?
Дата
Msg-id 1397694502283-5800459.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: any way for a transaction to "see" inserts done earlier in the transaction?  (Susan Cassidy <susan.cassidy@decisionsciencescorp.com>)
Ответы Re: Re: any way for a transaction to "see" inserts done earlier in the transaction?  (Robert DiFalco <robert.difalco@gmail.com>)
Список pgsql-general
One possibility is that the INSERT is going to a different table (having the
same name but existing in a different schema) that is visible/default to the
function but not outside of it.

Or the function on the server is not "current" and thus isn't doing what you
think it is.


> I do an insert via a function, which returns the new id, then later I try
> to SELECT on that id, and it doesn't find it.
>
> Could it be because the insert is done inside a function?

Not by itself; but that factor could be interacting with something else to
cause the observed behavior.  As noted above functions are able to maintain
their own "schema" environment so what is executed in one and outside of one
can indeed target different physical objects - which has nothing to do with
transaction visibility.


Susan Cassidy-3 wrote
> It is a fairly large and complex Perl program, so no, not really.

Then you need to recreate a functionally similar, but limited, test case
that either exhibits the behavior in question or causes you to realize what
you are doing in wrong in the "large and complex Perl program".

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/any-way-for-a-transaction-to-see-inserts-done-earlier-in-the-transaction-tp5800432p5800459.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


В списке pgsql-general по дате отправления:

Предыдущее
От: Susan Cassidy
Дата:
Сообщение: Re: any way for a transaction to "see" inserts done earlier in the transaction?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: any way for a transaction to "see" inserts done earlier in the transaction?