pgsql: Remove extra regress check arguments from test_pg_db_role_settin

2023-01-05 Thread Alexander Korotkov
Remove extra regress check arguments from test_pg_db_role_setting They were accidentally copied from test_oat_hooks. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20230102154240.GL1153%40telsasoft.com Reviewed-by: Pavel Borisov Branch -- master Details --- https://git.postg

pgsql: meson: Add 'running' test setup, as a replacement for installche

2023-01-05 Thread Alexander Korotkov
meson: Add 'running' test setup, as a replacement for installcheck Do the same as 3f0e786ccbf5 for test_pg_db_role_setting. Discussion: https://postgr.es/m/[email protected] Author: Pavel Borisov Reviewed-by: Justin Pryzby, Tom Lane Branch -- master Details --- https:/

pgsql: Fix calculation of which GENERATED columns need to be updated.

2023-01-05 Thread Tom Lane
Fix calculation of which GENERATED columns need to be updated. We were identifying the updatable generated columns of inheritance children by transposing the calculation made for their parent. However, there's nothing that says a traditional-inheritance child can't have generated columns that aren

pgsql: Fix calculation of which GENERATED columns need to be updated.

2023-01-05 Thread Tom Lane
Fix calculation of which GENERATED columns need to be updated. We were identifying the updatable generated columns of inheritance children by transposing the calculation made for their parent. However, there's nothing that says a traditional-inheritance child can't have generated columns that aren

pgsql: Fix calculation of which GENERATED columns need to be updated.

2023-01-05 Thread Tom Lane
Fix calculation of which GENERATED columns need to be updated. We were identifying the updatable generated columns of inheritance children by transposing the calculation made for their parent. However, there's nothing that says a traditional-inheritance child can't have generated columns that aren

pgsql: Fix calculation of which GENERATED columns need to be updated.

2023-01-05 Thread Tom Lane
Fix calculation of which GENERATED columns need to be updated. We were identifying the updatable generated columns of inheritance children by transposing the calculation made for their parent. However, there's nothing that says a traditional-inheritance child can't have generated columns that aren

pgsql: Refactor permissions-checking for role grants.

2023-01-05 Thread Robert Haas
Refactor permissions-checking for role grants. Instead of having checks in AddRoleMems() and DelRoleMems(), have the callers perform checks where it's required. In some cases it isn't, either because the caller has already performed a check for the same condition, or because the check couldn't pos

pgsql: Pass down current user ID to AddRoleMems and DelRoleMems.

2023-01-05 Thread Robert Haas
Pass down current user ID to AddRoleMems and DelRoleMems. This is just refactoring; there should be no functonal change. It might have the effect of slightly reducing the number of calls to GetUserId(), but the real point is to facilitate future work in this area. Patch by me, reviewed by Mark Di

pgsql: Use unnamed POSIX semaphores on Cygwin.

2023-01-05 Thread Thomas Munro
Use unnamed POSIX semaphores on Cygwin. Testing on CI showed that Cygwin's semctl() can fail with EAGAIN (possibly due to resource limits in cygserver that could be tuned, not examined). Switch to so-called POSIX semaphores instead, which don't seem to fail in that way (possibly due to a more dir

pgsql: Fix pg_truncate() on Windows.

2023-01-05 Thread Thomas Munro
Fix pg_truncate() on Windows. Commit 57faaf376 added pg_truncate(const char *path, off_t length), but "length" was ignored under WIN32 and the file was unconditionally truncated to 0. There was no live bug, since the only caller passes 0. Fix, and back-patch to 14 where the function arrived. Au

pgsql: Fix pg_truncate() on Windows.

2023-01-05 Thread Thomas Munro
Fix pg_truncate() on Windows. Commit 57faaf376 added pg_truncate(const char *path, off_t length), but "length" was ignored under WIN32 and the file was unconditionally truncated to 0. There was no live bug, since the only caller passes 0. Fix, and back-patch to 14 where the function arrived. Au

pgsql: Fix pg_truncate() on Windows.

2023-01-05 Thread Thomas Munro
Fix pg_truncate() on Windows. Commit 57faaf376 added pg_truncate(const char *path, off_t length), but "length" was ignored under WIN32 and the file was unconditionally truncated to 0. There was no live bug, since the only caller passes 0. Fix, and back-patch to 14 where the function arrived. Au