pgsql: doc: Add minimal C and SQL example to add a custom table AM hand

2024-10-06 Thread Michael Paquier
doc: Add minimal C and SQL example to add a custom table AM handler The documentation was rather sparse on this matter and there is no extension in-core that shows how to do it. Adding a small example will hopefully help newcomers. An advantage of writing things this way is that the contents are

pgsql: Use camel case for "DateStyle" in some error messages

2024-10-06 Thread Michael Paquier
Use camel case for "DateStyle" in some error messages This GUC is written as camel-case in most of the documentation and the GUC table (but not postgresql.conf.sample), and two error messages hardcoded it with lower case characters. Let's use a style more consistent. Most of the noise comes from

pgsql: libpq: Discard leading and trailing spaces for parameters and va

2024-10-06 Thread Michael Paquier
libpq: Discard leading and trailing spaces for parameters and values in URIs Integer values applied a parsing rule through pqParseIntParam() that made URIs like this one working, even if these include spaces around values: "postgresql://localhost:5432/postgres?keepalives=1 &keepalives_idle=1 " Th

pgsql: Move Cluster.pm initialization code to a more obvious place

2024-10-06 Thread Andrew Dunstan
Move Cluster.pm initialization code to a more obvious place Commit 460c0076e8 added some module intialization code to set signal handlers. However, that code has now become somewhat buried, as later commits added new subroutines. Therefore, move the initialization code to the module's INIT block w

pgsql: Ignore not-yet-defined Portals in pg_cursors view.

2024-10-06 Thread Tom Lane
Ignore not-yet-defined Portals in pg_cursors view. pg_cursor() supposed that any Portal it finds in the hash table must have sourceText set up, but there's an edge case where that is not so. A newly-created Portal has sourceText = NULL, and that doesn't change until PortalDefineQuery is called. I

pgsql: Ignore not-yet-defined Portals in pg_cursors view.

2024-10-06 Thread Tom Lane
Ignore not-yet-defined Portals in pg_cursors view. pg_cursor() supposed that any Portal it finds in the hash table must have sourceText set up, but there's an edge case where that is not so. A newly-created Portal has sourceText = NULL, and that doesn't change until PortalDefineQuery is called. I

pgsql: Ignore not-yet-defined Portals in pg_cursors view.

2024-10-06 Thread Tom Lane
Ignore not-yet-defined Portals in pg_cursors view. pg_cursor() supposed that any Portal it finds in the hash table must have sourceText set up, but there's an edge case where that is not so. A newly-created Portal has sourceText = NULL, and that doesn't change until PortalDefineQuery is called. I

pgsql: Ignore not-yet-defined Portals in pg_cursors view.

2024-10-06 Thread Tom Lane
Ignore not-yet-defined Portals in pg_cursors view. pg_cursor() supposed that any Portal it finds in the hash table must have sourceText set up, but there's an edge case where that is not so. A newly-created Portal has sourceText = NULL, and that doesn't change until PortalDefineQuery is called. I

pgsql: Ignore not-yet-defined Portals in pg_cursors view.

2024-10-06 Thread Tom Lane
Ignore not-yet-defined Portals in pg_cursors view. pg_cursor() supposed that any Portal it finds in the hash table must have sourceText set up, but there's an edge case where that is not so. A newly-created Portal has sourceText = NULL, and that doesn't change until PortalDefineQuery is called. I

pgsql: Ignore not-yet-defined Portals in pg_cursors view.

2024-10-06 Thread Tom Lane
Ignore not-yet-defined Portals in pg_cursors view. pg_cursor() supposed that any Portal it finds in the hash table must have sourceText set up, but there's an edge case where that is not so. A newly-created Portal has sourceText = NULL, and that doesn't change until PortalDefineQuery is called. I

pgsql: Ignore not-yet-defined Portals in pg_cursors view.

2024-10-06 Thread Tom Lane
Ignore not-yet-defined Portals in pg_cursors view. pg_cursor() supposed that any Portal it finds in the hash table must have sourceText set up, but there's an edge case where that is not so. A newly-created Portal has sourceText = NULL, and that doesn't change until PortalDefineQuery is called. I