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
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
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
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
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
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
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
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