How to drop table in slave postgres ?

Not applicable

I'm getting the below exception when I try to drop tables in slave

ERROR: recovery is in progress

HINT: WAL control functions cannot be executed during recovery.

0 7 1,161
7 REPLIES 7

Is this a generic Postgres question? If yes, then it's not the right forum. If you are using Apigee and experiencing this error, please provide more details so that we can help you.

Hmm - the on-premise customers in the forum dont see this as a generic Postgres question. Maybe this needs to be tagged a bit differently.

Moved to Private Cloud Deployment forum.

Not applicable

We are using Apigee and as part of purge and vaccum we are performing this.

The same script works fine for master postgres

Script:

export LD_LIBRARY_PATH=/opt/apigee4/share/pgsql-9.3/lib/ #DROP TABLE for i in `/opt/apigee4/share/pgsql-9.3/bin/psql -U xxx -d xxx -c "select tablename from analytics.childfactables where customer='amexlab~lab' and to_timestamp(starttime/1000) < (SELECT CURRENT_TIMESTAMP - interval '133 days')" |grep fact` do /opt/apigee4/share/pgsql-9.3/bin/psql -U xxx -d xxxx -c "drop table if exists analytics.\"$i\" cascade " done ;

Output:

++ /opt/apigee4/share/pgsql-9.3/bin/psql -U xxxxx -d xxxxx -c 'drop table if exists analytics."amexlab.lab.fact_5" cascade ' ERROR: cannot execute DROP TABLE in a read-only transaction

@Raju - we just took the recommended purge and vacuum steps and blew up a system - so I would be very interested in any information or experiences you can share here.

Not applicable

HI Benjamin - hope you are affected in lower environments only 🙂 . So what we got an update through the case is (1) Perform the purge and vaccum only on master postgres

(2) don't perform anything on slave.

Did this help or you are looking for anything specific ?

@Raju

Yes it was a non production environment (!!! Luckily) Another upside: we are getting to validate the restore process at the same time.

This last thing is something i encourage everyone to do at least once.

It looks like your purge script is VERY different from the one that is in the operations guide. Do you mind sharing the source?