Re: No Callbacks on FATAL

2023-01-13 Thread Andres Freund
Hi, On 2023-01-13 16:14:11 +0300, Aleksander Alekseev wrote: > > > Hm? MemoryContextDelete() unconditionally calls the > > > callbacks. ShutdownPostgres() calls AbortOutOfAnyTransaction(). So if > > > there's > > > an ongoing transaction, we'll call the reset callbacks on > > > TopMemoryContext

Re: No Callbacks on FATAL

2023-01-13 Thread Aleksander Alekseev
Hi hackers, > > Hm? MemoryContextDelete() unconditionally calls the > > callbacks. ShutdownPostgres() calls AbortOutOfAnyTransaction(). So if > > there's > > an ongoing transaction, we'll call the reset callbacks on TopMemoryContext > > and > > its children. > > Hmm ... I'd forgotten that we'd r

Re: No Callbacks on FATAL

2023-01-11 Thread Tom Lane
Andres Freund writes: > On 2023-01-11 18:10:33 -0500, Tom Lane wrote: >> It's intended behavior, and I seriously doubt that it ever worked >> differently. > Hm? MemoryContextDelete() unconditionally calls the > callbacks. ShutdownPostgres() calls AbortOutOfAnyTransaction(). So if there's > an ong

Re: No Callbacks on FATAL

2023-01-11 Thread Andres Freund
Hi, On 2023-01-11 18:10:33 -0500, Tom Lane wrote: > Ed Behn writes: > > I'm using a callback function that is called when a memory context is > > deleted to remove a temporary file. This works fine when the transaction > > ends normally or raises an ERROR. However, when a FATAL event happens, the

Re: No Callbacks on FATAL

2023-01-11 Thread Tom Lane
Ed Behn writes: > I'm using a callback function that is called when a memory context is > deleted to remove a temporary file. This works fine when the transaction > ends normally or raises an ERROR. However, when a FATAL event happens, the > callback is not run. Is this a bug or intended behaviour

Re: No Callbacks on FATAL

2023-01-11 Thread Andres Freund
Hi, On 2023-01-11 17:47:28 -0500, Ed Behn wrote: > I'm developing a module that implements Haskell as a procedural language ( > https://www.postgresql.org/about/news/plhaskell-v10-released-2519/) > > I'm using a callback function that is called when a memory context is > deleted to remove a tempo

No Callbacks on FATAL

2023-01-11 Thread Ed Behn
I'm developing a module that implements Haskell as a procedural language ( https://www.postgresql.org/about/news/plhaskell-v10-released-2519/) I'm using a callback function that is called when a memory context is deleted to remove a temporary file. This works fine when the transaction ends normall