pgsql: Fix memory leak on DSM slot exhaustion.

2020-01-31 Thread Thomas Munro
Fix memory leak on DSM slot exhaustion. If we attempt to create a DSM segment when no slots are available, we should return the memory to the operating system. Previously we did that if the DSM_CREATE_NULL_IF_MAXSEGMENTS flag was passed in, but we didn't do it if an error was raised. Repair. Ba

pgsql: Fix memory leak on DSM slot exhaustion.

2020-01-31 Thread Thomas Munro
Fix memory leak on DSM slot exhaustion. If we attempt to create a DSM segment when no slots are available, we should return the memory to the operating system. Previously we did that if the DSM_CREATE_NULL_IF_MAXSEGMENTS flag was passed in, but we didn't do it if an error was raised. Repair. Ba

pgsql: Fix memory leak on DSM slot exhaustion.

2020-01-31 Thread Thomas Munro
Fix memory leak on DSM slot exhaustion. If we attempt to create a DSM segment when no slots are available, we should return the memory to the operating system. Previously we did that if the DSM_CREATE_NULL_IF_MAXSEGMENTS flag was passed in, but we didn't do it if an error was raised. Repair. Ba

pgsql: Fix memory leak on DSM slot exhaustion.

2020-01-31 Thread Thomas Munro
Fix memory leak on DSM slot exhaustion. If we attempt to create a DSM segment when no slots are available, we should return the memory to the operating system. Previously we did that if the DSM_CREATE_NULL_IF_MAXSEGMENTS flag was passed in, but we didn't do it if an error was raised. Repair. Ba

pgsql: Fix memory leak on DSM slot exhaustion.

2020-01-31 Thread Thomas Munro
Fix memory leak on DSM slot exhaustion. If we attempt to create a DSM segment when no slots are available, we should return the memory to the operating system. Previously we did that if the DSM_CREATE_NULL_IF_MAXSEGMENTS flag was passed in, but we didn't do it if an error was raised. Repair. Ba

pgsql: Fix memory leak on DSM slot exhaustion.

2020-01-31 Thread Thomas Munro
Fix memory leak on DSM slot exhaustion. If we attempt to create a DSM segment when no slots are available, we should return the memory to the operating system. Previously we did that if the DSM_CREATE_NULL_IF_MAXSEGMENTS flag was passed in, but we didn't do it if an error was raised. Repair. Ba

pgsql: Fix not-quite-right string comparison in parse_jsonb_index_flags

2020-01-31 Thread Tom Lane
Fix not-quite-right string comparison in parse_jsonb_index_flags(). This code would accept "strinX", where X is any 1-byte character, as meaning "string". Clearly it wasn't meant to do that. No back-patch, since this doesn't affect correct queries and there's some tiny chance we'd break somebody

pgsql: Fix CheckAttributeType's handling of collations for ranges.

2020-01-31 Thread Tom Lane
Fix CheckAttributeType's handling of collations for ranges. Commit fc7695891 changed CheckAttributeType to recurse into ranges, but made it pass down the wrong collation (always InvalidOid, since ranges as such have no collation). This would result in guaranteed failure when considering a range t

pgsql: Fix CheckAttributeType's handling of collations for ranges.

2020-01-31 Thread Tom Lane
Fix CheckAttributeType's handling of collations for ranges. Commit fc7695891 changed CheckAttributeType to recurse into ranges, but made it pass down the wrong collation (always InvalidOid, since ranges as such have no collation). This would result in guaranteed failure when considering a range t

pgsql: Fix CheckAttributeType's handling of collations for ranges.

2020-01-31 Thread Tom Lane
Fix CheckAttributeType's handling of collations for ranges. Commit fc7695891 changed CheckAttributeType to recurse into ranges, but made it pass down the wrong collation (always InvalidOid, since ranges as such have no collation). This would result in guaranteed failure when considering a range t

pgsql: Fix CheckAttributeType's handling of collations for ranges.

2020-01-31 Thread Tom Lane
Fix CheckAttributeType's handling of collations for ranges. Commit fc7695891 changed CheckAttributeType to recurse into ranges, but made it pass down the wrong collation (always InvalidOid, since ranges as such have no collation). This would result in guaranteed failure when considering a range t

pgsql: Fix CheckAttributeType's handling of collations for ranges.

2020-01-31 Thread Tom Lane
Fix CheckAttributeType's handling of collations for ranges. Commit fc7695891 changed CheckAttributeType to recurse into ranges, but made it pass down the wrong collation (always InvalidOid, since ranges as such have no collation). This would result in guaranteed failure when considering a range t

pgsql: Fix CheckAttributeType's handling of collations for ranges.

2020-01-31 Thread Tom Lane
Fix CheckAttributeType's handling of collations for ranges. Commit fc7695891 changed CheckAttributeType to recurse into ranges, but made it pass down the wrong collation (always InvalidOid, since ranges as such have no collation). This would result in guaranteed failure when considering a range t

pgsql: Fix CheckAttributeType's handling of collations for ranges.

2020-01-31 Thread Tom Lane
Fix CheckAttributeType's handling of collations for ranges. Commit fc7695891 changed CheckAttributeType to recurse into ranges, but made it pass down the wrong collation (always InvalidOid, since ranges as such have no collation). This would result in guaranteed failure when considering a range t

pgsql: Fix parallel pg_dump/pg_restore for failure to create worker pro

2020-01-31 Thread Tom Lane
Fix parallel pg_dump/pg_restore for failure to create worker processes. If we failed to fork a worker process, or create a communication pipe for one, WaitForTerminatingWorkers would suffer an assertion failure if assert-enabled, otherwise crash or go into an infinite loop. This was a consequence

pgsql: Fix parallel pg_dump/pg_restore for failure to create worker pro

2020-01-31 Thread Tom Lane
Fix parallel pg_dump/pg_restore for failure to create worker processes. If we failed to fork a worker process, or create a communication pipe for one, WaitForTerminatingWorkers would suffer an assertion failure if assert-enabled, otherwise crash or go into an infinite loop. This was a consequence

pgsql: Fix parallel pg_dump/pg_restore for failure to create worker pro

2020-01-31 Thread Tom Lane
Fix parallel pg_dump/pg_restore for failure to create worker processes. If we failed to fork a worker process, or create a communication pipe for one, WaitForTerminatingWorkers would suffer an assertion failure if assert-enabled, otherwise crash or go into an infinite loop. This was a consequence

pgsql: Fix parallel pg_dump/pg_restore for failure to create worker pro

2020-01-31 Thread Tom Lane
Fix parallel pg_dump/pg_restore for failure to create worker processes. If we failed to fork a worker process, or create a communication pipe for one, WaitForTerminatingWorkers would suffer an assertion failure if assert-enabled, otherwise crash or go into an infinite loop. This was a consequence

pgsql: Fix parallel pg_dump/pg_restore for failure to create worker pro

2020-01-31 Thread Tom Lane
Fix parallel pg_dump/pg_restore for failure to create worker processes. If we failed to fork a worker process, or create a communication pipe for one, WaitForTerminatingWorkers would suffer an assertion failure if assert-enabled, otherwise crash or go into an infinite loop. This was a consequence

pgsql: Fix parallel pg_dump/pg_restore for failure to create worker pro

2020-01-31 Thread Tom Lane
Fix parallel pg_dump/pg_restore for failure to create worker processes. If we failed to fork a worker process, or create a communication pipe for one, WaitForTerminatingWorkers would suffer an assertion failure if assert-enabled, otherwise crash or go into an infinite loop. This was a consequence

pgsql: Fix parallel pg_dump/pg_restore for failure to create worker pro

2020-01-31 Thread Tom Lane
Fix parallel pg_dump/pg_restore for failure to create worker processes. If we failed to fork a worker process, or create a communication pipe for one, WaitForTerminatingWorkers would suffer an assertion failure if assert-enabled, otherwise crash or go into an infinite loop. This was a consequence

pgsql: Allow building without default socket directory

2020-01-31 Thread Peter Eisentraut
Allow building without default socket directory We have code paths for Unix socket support and no Unix socket support. Now add a third variant: Unix socket support but do not use a Unix socket by default in the client or the server, only if you explicitly specify one. This will be useful when we

pgsql: Sprinkle some const decorations

2020-01-31 Thread Peter Eisentraut
Sprinkle some const decorations This might help clarify the API a bit. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7c23bfd25c423b4513a16d41c5e4d09c32807155 Modified Files -- src/backend/libpq/pqcomm.c | 12 ++-- src/include/libpq/libpq.h |