Home Error in Postgres TX
Reply: 1

Error in Postgres TX

Jorge Silva
Jorge Silva Published in 2017-12-07 19:35:03Z

Trying to create a user in the database and it's telling me that cannot execute **** in a read-only transaction. I have no idea what's causing this? Is this a bad state in the database or connection? Why is this telling that it's not in a transaction but then telling me it's a read-only transaction? Does "transaction" refer to the same thing?

$ psql --host localhost --port 5432 --username **** postgres --no-password -v dbuser=root -t -X
psql (10.1, server 9.4.13)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

postgres=# set transaction read write;
WARNING:  SET TRANSACTION can only be used in transaction blocks
ERROR:  cannot set transaction read-write mode during recovery
postgres=# CREATE USER root WITH PASSWORD 'root';
ERROR:  cannot execute CREATE ROLE in a read-only transaction
Laurenz Albe
Laurenz Albe Reply to 2017-12-07 20:58:16Z

Your database is in recovery.

Either it is a hot standby (most likely), or recovery was paused with SELECT pg_wal_replay_pause() or recovery_target_action = 'pause' in recovery.conf (check with SELECT pg_is_wal_replay_paused()), or a point-in-time-recovery is still running.

Use the primary or complete recovery.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.504335 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO