pgsql: Avoid invalid array reference in transformAlterTableStmt().

2022-04-18 Thread Tom Lane
Avoid invalid array reference in transformAlterTableStmt(). Don't try to look at the attidentity field of system attributes, because they're not there in the TupleDescAttr array. Sometimes this is harmless because we accidentally pick up a zero, but otherwise we'll report "no owned sequence found

pgsql: Avoid invalid array reference in transformAlterTableStmt().

2022-04-18 Thread Tom Lane
Avoid invalid array reference in transformAlterTableStmt(). Don't try to look at the attidentity field of system attributes, because they're not there in the TupleDescAttr array. Sometimes this is harmless because we accidentally pick up a zero, but otherwise we'll report "no owned sequence found

pgsql: Avoid invalid array reference in transformAlterTableStmt().

2022-04-18 Thread Tom Lane
Avoid invalid array reference in transformAlterTableStmt(). Don't try to look at the attidentity field of system attributes, because they're not there in the TupleDescAttr array. Sometimes this is harmless because we accidentally pick up a zero, but otherwise we'll report "no owned sequence found

pgsql: Avoid invalid array reference in transformAlterTableStmt().

2022-04-18 Thread Tom Lane
Avoid invalid array reference in transformAlterTableStmt(). Don't try to look at the attidentity field of system attributes, because they're not there in the TupleDescAttr array. Sometimes this is harmless because we accidentally pick up a zero, but otherwise we'll report "no owned sequence found

pgsql: Avoid invalid array reference in transformAlterTableStmt().

2022-04-18 Thread Tom Lane
Avoid invalid array reference in transformAlterTableStmt(). Don't try to look at the attidentity field of system attributes, because they're not there in the TupleDescAttr array. Sometimes this is harmless because we accidentally pick up a zero, but otherwise we'll report "no owned sequence found

pgsql: Avoid invalid array reference in transformAlterTableStmt().

2022-04-18 Thread Tom Lane
Avoid invalid array reference in transformAlterTableStmt(). Don't try to look at the attidentity field of system attributes, because they're not there in the TupleDescAttr array. Sometimes this is harmless because we accidentally pick up a zero, but otherwise we'll report "no owned sequence found

pgsql: Add missing error handling in pg_md5_hash().

2022-04-18 Thread Tom Lane
Add missing error handling in pg_md5_hash(). It failed to provide an error string as expected for the admittedly-unlikely case of OOM in pg_cryptohash_create(). Also, make it initialize *errstr to NULL for success, as pg_md5_binary() does. Also add missing comments. Readers should not have to re

pgsql: Fix the check to limit sync workers.

2022-04-18 Thread Amit Kapila
Fix the check to limit sync workers. We don't allow to invoke more sync workers once we have reached the sync worker limit per subscription. But the check to enforce this also doesn't allow to launch an apply worker if it gets restarted. This code was introduced by commit de43897122 but we caught

pgsql: Fix the check to limit sync workers.

2022-04-18 Thread Amit Kapila
Fix the check to limit sync workers. We don't allow to invoke more sync workers once we have reached the sync worker limit per subscription. But the check to enforce this also doesn't allow to launch an apply worker if it gets restarted. This code was introduced by commit de43897122 but we caught

pgsql: Fix the check to limit sync workers.

2022-04-18 Thread Amit Kapila
Fix the check to limit sync workers. We don't allow to invoke more sync workers once we have reached the sync worker limit per subscription. But the check to enforce this also doesn't allow to launch an apply worker if it gets restarted. This code was introduced by commit de43897122 but we caught

pgsql: Fix the check to limit sync workers.

2022-04-18 Thread Amit Kapila
Fix the check to limit sync workers. We don't allow to invoke more sync workers once we have reached the sync worker limit per subscription. But the check to enforce this also doesn't allow to launch an apply worker if it gets restarted. This code was introduced by commit de43897122 but we caught

pgsql: Fix the check to limit sync workers.

2022-04-18 Thread Amit Kapila
Fix the check to limit sync workers. We don't allow to invoke more sync workers once we have reached the sync worker limit per subscription. But the check to enforce this also doesn't allow to launch an apply worker if it gets restarted. This code was introduced by commit de43897122 but we caught

pgsql: Fix the check to limit sync workers.

2022-04-18 Thread Amit Kapila
Fix the check to limit sync workers. We don't allow to invoke more sync workers once we have reached the sync worker limit per subscription. But the check to enforce this also doesn't allow to launch an apply worker if it gets restarted. This code was introduced by commit de43897122 but we caught