Hi, On 2020-04-10 16:29:39 -0400, Tom Lane wrote: > Andres Freund <and...@anarazel.de> writes: > > I don't think a function is a good idea - it'll cause a snapshot to be > > held while waiting. Which in turn will cause hot_standby_feedback to not > > be able to report an increased xmin up. And it will possibly hit > > snapshot recovery conflicts. > > Good point, but we could address that by making it a procedure no?
Probably. Don't think we have great infrastructure for builtin procedures yet though? We'd presumably not want to use plpgsql. ISTM that we can make it BEGIN AFTER 'xx/xx' or such, which'd not require any keywords, it'd be easier to use than a procedure. With a separate procedure, you'd likely need more roundtrips / complex logic at the client. You either need to check first if the procedure errored ou, and then send the BEGIN, or send both together and separate out potential errors. Greetings, Andres Freund