Re: DROP OWNED BY fails to clean out pg_init_privs grants

From: Егор Чиндяскин <kyzevan23(at)mail(dot)ru>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Gustafsson <daniel(at)yesql(dot)se>, David G(dot) Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, Noah Misch <nmisch(at)google(dot)com>, Hannu Krosing <hannuk(at)google(dot)com>
Subject: Re: DROP OWNED BY fails to clean out pg_init_privs grants
Date: 2024-09-18 04:03:21
Message-ID: 1726632201.345023799@f532.i.mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


 
>On Thu, Jun 20, 2024 at 3:43PM Hannu Krosing < hannuk(at)google(dot)com > wrote:
>> Still it would be nice to have some public support for users of
>> non-managed PostgreSQL databases as well
>+1.
>
>--
>Robert Haas
>EDB: http://www.enterprisedb.com
Hello! I have recently been researching postgres build using meson. And I came across a failure of the src/test/modules/test_pg_dump-running test.
You can see regression.diffs in attached file.
It turned out that the test fails if the cluster is initialized by custom user. In my case by user postgres.
Script to reproduce test_pg_fump failure:
---
meson setup -Dprefix=$PGPREFIX build
 
ninja -j64 -C build install >/dev/null
ninja -j64 -C build install-test-files >/dev/null
 
initdb -U postgres -k -D $PGPREFIX/data
pg_ctl -D $PGPREFIX/data -l logfile start
 
psql -U postgres -c "CREATE USER test SUPERUSER"
psql -U postgres -c "CREATE DATABASE test"
 
meson test --setup running --suite postgresql:test_pg_dump-running -C build/
---
You can catch the same failure if build using make and run make installcheck -C src/test/modules/test_pg_dump.
 
I have looked at the test and found queries like below:
---
SELECT pg_describe_object(classid,objid,objsubid) COLLATE "C" AS obj,
  pg_describe_object(refclassid,refobjid,0) AS refobj,
  deptype
  FROM pg_shdepend JOIN pg_database d ON dbid = d.oid
  WHERE d.datname = current_database()
  ORDER BY 1, 3;
---
This query does not expect that test database may already contain some information about custom user that ran test_pg_dump-running.
--
Egor Chindyaskin
Postgres Professional: https://postgrespro.com
 

Attachment Content-Type Size
regression.diffs application/octet-stream 21.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-09-18 04:16:12 define pg_structiszero(addr, s, r)
Previous Message Michael Paquier 2024-09-18 03:54:48 Re: Switch PgStat_HashKey.objoid from Oid to uint64