pgsql: Show parameters of CALL as constants in pg_stat_statements

2023-09-27 Thread Michael Paquier
Show parameters of CALL as constants in pg_stat_statements This commit changes the query jumbling of CallStmt so as its IN/OUT parameters are able to show up as constants with a parameter symbol in pg_stat_statements, like: CALL proc1($1, $2); CALL proc2($1, $2, $3); The transformed FuncExpr is u

Re: pgsql: Remove obsolete executor cleanup code

2023-09-27 Thread Amit Langote
On Thu, Sep 28, 2023 at 10:08 AM Tom Lane wrote: > Amit Langote writes: > > After these modifications, the ExecEnd*() routines for ValuesScan, > > NamedTuplestoreScan, and WorkTableScan became redundant. So, this > > commit removes them. > > This seems like quite a bad idea. From a documentation

Re: pgsql: Remove obsolete executor cleanup code

2023-09-27 Thread Tom Lane
Amit Langote writes: > After these modifications, the ExecEnd*() routines for ValuesScan, > NamedTuplestoreScan, and WorkTableScan became redundant. So, this > commit removes them. This seems like quite a bad idea. From a documentation standpoint alone, it would be far better for these functions

pgsql: Remove obsolete executor cleanup code

2023-09-27 Thread Amit Langote
Remove obsolete executor cleanup code This commit removes unnecessary ExecExprFreeContext() calls in ExecEnd* routines because the actual cleanup is managed by FreeExecutorState(). With no callers remaining for ExecExprFreeContext(), this commit also removes the function. This commit also drops r

pgsql: Move tracking of in_streaming to PGOutputData

2023-09-27 Thread Michael Paquier
Move tracking of in_streaming to PGOutputData "in_streaming" is a flag used to track if an instance of pgoutput is streaming changes. When pgoutput is started, the flag was always reset, switched it back and forth in the stream start/stop callbacks. Before this commit, it was a global variable,

pgsql: Add TupleDescGetDefault()

2023-09-27 Thread Peter Eisentraut
Add TupleDescGetDefault() This unifies some repetitive code. Note: I didn't push the "not found" error message into the new function, even though all existing callers would be able to make use of it. Using the existing error handling as-is would probably require exposing the Relation type via tu

pgsql: llvmjit: Make llvm_types_module variable static

2023-09-27 Thread Daniel Gustafsson
llvmjit: Make llvm_types_module variable static Commit b059d2f45685a introduced llvm_types_module and accidentally exported it. As there is no usecase for accessing this variable externally, this makes it static. Author: Andres Freund Reviewed-by: Daniel Gustafsson Discussion: https://postgr.e

pgsql: llvmjit: Use explicit LLVMContextRef for inlining

2023-09-27 Thread Daniel Gustafsson
llvmjit: Use explicit LLVMContextRef for inlining When performing inlining LLVM unfortunately "leaks" types (the types survive and are usable, but a new round of inlining will recreate new structurally equivalent types). This accumulation will over time amount to a memory leak which for some queri

pgsql: llvmjit: Remove unnecessary types

2023-09-27 Thread Daniel Gustafsson
llvmjit: Remove unnecessary types These types were added in fb46ac26fe but hasn't been used, so remove until there is a need for them. Author: Andres Freund Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/20221101055132.pjjsvlkeo4stb...@awork3.anarazel.de Branch -- master

pgsql: Fix the misuse of origin filter across multiple pg_logical_slot_

2023-09-27 Thread Amit Kapila
Fix the misuse of origin filter across multiple pg_logical_slot_get_changes() calls. The pgoutput module uses a global variable (publish_no_origin) to cache the action for the origin filter, but we didn't reset the flag when shutting down the output plugin, so subsequent retries may access the pr

pgsql: Fix the misuse of origin filter across multiple pg_logical_slot_

2023-09-27 Thread Amit Kapila
Fix the misuse of origin filter across multiple pg_logical_slot_get_changes() calls. The pgoutput module uses a global variable (publish_no_origin) to cache the action for the origin filter, but we didn't reset the flag when shutting down the output plugin, so subsequent retries may access the pr