Re: [HACKERS] legitimacy of using PG_TRY , PG_CATCH , PG_END_TRY in C function

2017-10-26 Thread Robert Haas
On Mon, Oct 23, 2017 at 10:27 AM, Andres Freund wrote: > It'd probably be a good idea to expand on this in the sgml docs. This > has confused quite anumber of people... That's a good idea. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via

Re: [HACKERS] legitimacy of using PG_TRY , PG_CATCH , PG_END_TRY in C function

2017-10-23 Thread Andres Freund
On 2017-10-22 23:04:50 -0400, Tom Lane wrote: > John Lumby writes: > > I have a C function (a trigger function) which uses the PG_TRY() > > construct to handle certain ERROR conditions. > > One example is where invoked as INSTEAD OF INSERT into a view. It > > PG_TRYs INSERT into the real base t

Re: [HACKERS] legitimacy of using PG_TRY , PG_CATCH , PG_END_TRY in C function

2017-10-23 Thread Andres Freund
On 2017-10-23 16:16:10 +0800, Craig Ringer wrote: > On 23 October 2017 at 08:30, John Lumby wrote: > > > All works but not perfectly -- at COMMIT, resource_owner issues > > relcache reference leak messages about relation scans not closed > > and also about snapshot still active. I guess th

Re: [HACKERS] legitimacy of using PG_TRY , PG_CATCH , PG_END_TRY in C function

2017-10-23 Thread Craig Ringer
On 23 October 2017 at 16:16, Craig Ringer wrote: > On 23 October 2017 at 08:30, John Lumby wrote: > >> All works but not perfectly -- at COMMIT, resource_owner issues >> relcache reference leak messages about relation scans not closed >> and also about snapshot still active. I guess that t

Re: [HACKERS] legitimacy of using PG_TRY , PG_CATCH , PG_END_TRY in C function

2017-10-23 Thread Craig Ringer
On 23 October 2017 at 08:30, John Lumby wrote: > All works but not perfectly -- at COMMIT, resource_owner issues > relcache reference leak messages about relation scans not closed > and also about snapshot still active. I guess that the CREATE has > switched resource_owner and pushed a sna

Re: [HACKERS] legitimacy of using PG_TRY , PG_CATCH , PG_END_TRY in C function

2017-10-22 Thread Tom Lane
John Lumby writes: > I have a C function (a trigger function) which uses the PG_TRY() > construct to handle certain ERROR conditions. > One example is where invoked as INSTEAD OF INSERT into a view. It > PG_TRYs INSERT into the real base table, > but this table may not yet exist (it is a parti

[HACKERS] legitimacy of using PG_TRY , PG_CATCH , PG_END_TRY in C function

2017-10-22 Thread John Lumby
I have a C function (a trigger function) which uses the PG_TRY() construct to handle certain ERROR conditions. One example is where invoked as INSTEAD OF INSERT into a view. It PG_TRYs INSERT into the real base table, but this table may not yet exist (it is a partitioned child of an inheritanc