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

Re: could not open relation with OID

2022-01-27 Thread Ben Chobot
Michael Paquier wrote on 1/26/22 9:14 PM: On Wed, Jan 26, 2022 at 05:30:01PM -0800, Ben Chobot wrote: Other things we've considered:     - we run pg_repack, which certainly seems like it could make an error like this, but we see this error in places and times that pg_repack isn't currently runn

Re: could not open relation with OID

2022-01-26 Thread Michael Paquier
queries > fail with errors like: > > could not open relation with OID 201940279 > > In the cases we've examined so far, the failed query succeeds just fine when > we run it manually. The failed query also had run on an async streaming > replica, and the primary has com

could not open relation with OID

2022-01-26 Thread Ben Chobot
We do a lot of queries per day, over a lot of hosts, all of which are on 12.9. We've recently started doing a better job at analyzing our db logs and have found that, a few times a day, every day, we see some of our queries fail with errors like: could not open relation with OID 20194027

Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-15 Thread Hans Schou
On Thu, Mar 15, 2018 at 12:44 AM, Tom Lane wrote: > > The query does fail on < 9.2, because on rows with no reltoastrelid > Thats, fine. I will live with that until upgrade. > But hey, it's a wiki; > if you feel more ambitious, edit away. > I tried but it said: "The site you are trying to log

Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-15 Thread Hans Schou
On Thu, Mar 15, 2018 at 12:32 AM, Michael Paquier wrote: > > I'm running version 9.1.9 so it should be working according to the > > wiki. > > You should update and upgrade. 9.1 has fallen out of community support > I will recommend that to the database owner. Thanks

Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-14 Thread Tom Lane
Michael Paquier writes: > On Wed, Mar 14, 2018 at 04:17:54PM +0100, Hans Schou wrote: >> I got the message >> ERROR: could not open relation with OID 0 >> when running the "General Table Size Information" from >> https://wiki.postgresql.org/wiki/Disk_Usag

Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-14 Thread Michael Paquier
On Wed, Mar 14, 2018 at 04:17:54PM +0100, Hans Schou wrote: > I got the message > ERROR: could not open relation with OID 0 > when running the "General Table Size Information" from > https://wiki.postgresql.org/wiki/Disk_Usage I cannot see this failure on latest HEAD on

wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-14 Thread Hans Schou
Hi I got the message ERROR: could not open relation with OID 0 when running the "General Table Size Information" from https://wiki.postgresql.org/wiki/Disk_Usage This patch gives some system tables @@ -12,5 +12,6 @@ FROM pg_class c LEFT JOIN pg_namespace

Re: Possible bug: could not open relation with OID [numbers] SQL State: XX000

2018-01-19 Thread pinker
p_table106538relpages:1reltuples:1relallvisible:0reltoastrelid:*106541*}psql:/tmp/gg:23: NOTICE: rel size 32768psql:/tmp/gg:23: ERROR: could not open relation with OID *106541* Thank you for the advice about ON COMMIT DROP - it's working.When the table size is smaller, about 16k this issue simply disappears. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html