Re: why does plperl cache functions using just a bool for is_trigger

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: why does plperl cache functions using just a bool for is_trigger
Дата
Msg-id 1288864485.2686.21.camel@hvost
обсуждение исходный текст
Ответ на Re: why does plperl cache functions using just a bool for is_trigger  (Hannu Krosing <hannu@2ndQuadrant.com>)
Ответы Re: why does plperl cache functions using just a bool for is_trigger  (Alex Hunsaker <badalex@gmail.com>)
Список pgsql-hackers
On Thu, 2010-11-04 at 11:46 +0200, Hannu Krosing wrote:
> On Wed, 2010-11-03 at 21:43 +0100, Jan Urbański wrote:
> > The validator is ready, once I'm done with the hash tables I'll try to
> > fix up the error checking (get rid of the global error state) and
> > finally do what started it all, that is make plpythonu use
> > subtransactions for SPI and be able to do:
> > 
> > try:
> >     plpy.execute("insert into foo values(1)")
> > except plpy.UniqueViolation, e:
> >     plpy.notice("Ooops, you got yourself a SQLSTATE %d", e.sqlstate)
> 
> Are you sure that having each try/except use a subtransaction is the
> right way to do it ?

Another objection 

> I'd like to make it more explicit and use 
> 
> with plpy.subtransaction():
>     do your stuff

Possibly better syntax would be

with plpy.subtransaction() as subtrx:   try:       plpy.execute("insert into foo values(1)")   except
plpy.UniqueViolation,e:       subtrx.rollback()       plpy.notice("Ooops, you got yourself a SQLSTATE %d", e.sqlstate)
 


-------
Hannu Krosing
PostgreSQL Infinite Scalability and Preformance Consultant
PG Admin Book: http://www.2ndQuadrant.com/books/




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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: why does plperl cache functions using just a bool for is_trigger
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: Hash support for arrays