On 2018/10/01 4:20, Tom Lane wrote: > Running the regression tests with the patch I showed in > https://www.postgresql.org/message-id/16565.1538327...@sss.pgh.pa.us > exposes two places where HEAD is opening relations without having > any lock at all on them:
Maybe you've noticed but the relation_open calls coming from bootstrap.c all pass NoLock which trigger the WARNING: $ initdb -D /tmp/foo <snip> WARNING: relation_open: no lock held on pg_type WARNING: relation_open: no lock held on pg_attrdef WARNING: relation_open: no lock held on pg_constraint WARNING: relation_open: no lock held on pg_inherits WARNING: relation_open: no lock held on pg_index WARNING: relation_open: no lock held on pg_operator WARNING: relation_open: no lock held on pg_opfamily <so on> Do we need to do something about that, like teaching boot_openrel() and gettype() in bootstrap.c to pass AccessShareLock instead of NoLock? Thanks, Amit