Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Marcelo Zabani
Thank you all for your comments. > I would think that the queries in that case would be running as a superuser in order to do the migrations. Users of codd can choose the role that applies their migrations. Codd even supports individual migrations running with ad-hoc users (so that a migration ca

Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Adrian Klaver
On 8/25/24 08:36, Marcelo Zabani wrote: > we do some special stuff for catalogs That is good to know, thanks! > I believe you could actually lock the pg_class rows for update. Just add FOR UPDATE at the end of the query. Thanks, but I tried that and got "ERROR:  permission denied for table

Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Tomas Vondra
On 8/25/24 17:36, Marcelo Zabani wrote: >> we do some special stuff for catalogs > > That is good to know, thanks! > >> I believe you could actually lock the pg_class rows for update. Just > add FOR UPDATE at the end of the query. > > Thanks, but I tried that and got "ERROR:  permission denie

Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Marcelo Zabani
bash script > > that reproduces it (not always, you might have to run it many times > > until you see ERROR: could not open relation with OID ): > > > > #!/usr/bin/env bash > > psql -c "create table test(x serial primary key); select oid, relname > > from

Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Tomas Vondra
gt; until you see ERROR:  could not open relation with OID ): > > #!/usr/bin/env bash > psql -c "create table test(x serial primary key); select oid, relname > from pg_class where relname='test'" > # The next two queries will run concurrently > psql -c

Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Marcelo Zabani
hen querying >> catalog tables while DDL is happening concurrently. Here's a bash script >> that reproduces it (not always, you might have to run it many times until >> you see ERROR: could not open relation with OID ): >> > [snip] > >> I've seen thi

Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Ron Johnson
it many times until > you see ERROR: could not open relation with OID ): > [snip] > I've seen this happen in Production without pg_sleep in the mix, too. I > added pg_sleep to the example above only because it makes the error easier > to reproduce. > What version (includ

ERROR: could not open relation with OID XXXX

2024-08-25 Thread Marcelo Zabani
Hi all, I can reproduce the error in the subject from time to time when querying catalog tables while DDL is happening concurrently. Here's a bash script that reproduces it (not always, you might have to run it many times until you see ERROR: could not open relation with OID ): #!/us