Can't query system tables during transaction

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Can't query system tables during transaction
Date: 2020-10-04 20:14:29
Message-ID: CA+FnnTyiz8i86MAVWriL4wzC1iSiZvqGjUpAMHiZoP+4cZNE1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, ALL,
I'm trying to execute following:

SELECT 1 FROM pg_class c, pg_namespace n WHERE n.oid = c.relnamespace
AND c.relname = 'foo' AND n.nspname = public;

inside the transaction.

I'm getting the following error:

ERROR: current transaction is aborted, commands ignored until end of
transaction block

Does this mean I can't query system tables during the transaction?
What is the problem here if it's not and how do I find out the reason?
And if it is - how to work around it?

I can probably commit it and start a new transaction, but I fear I will
have the same issue there...

Thank you.

If it matters - I'm working with C++ and libpq.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-10-04 20:24:49 Re: Can't query system tables during transaction
Previous Message Robert Inder 2020-10-04 20:11:15 Re: Writing WAL files