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
> 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 pg_class", even if I try it only for tables t

Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Tomas Vondra
On 8/25/24 15:42, Marcelo Zabani wrote: > 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:  co

Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Marcelo Zabani
> What version (including minor number)? On my computer I can reproduce the error with v16.1. At my job I know it's v15 but I can't access it right now so don't know the minor version. In any case, at my job it's much bigger queries we run; I'll elaborate why below. > Just out of curiosity, *WHY*

Re: ERROR: could not open relation with OID XXXX

2024-08-25 Thread Ron Johnson
On Sun, Aug 25, 2024 at 9:42 AM Marcelo Zabani wrote: > 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