postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Operator doesn't create prepared databases after standby replication from standalone source

Open klefevre opened this issue 1 year ago • 1 comments

Hello,

I’ve encountered an interesting situation where I "hacked" (is it?) the operator to use the standby feature for replicating a standalone PostgreSQL database located on a remote server into my Kubernetes cluster. The source database's tables were in the postgres database.

The replication worked so well that the operator didn’t perform some expected tasks, specifically:

  1. It didn’t create the database I specified in the preparedDatabase .
  2. It didn’t create any users, even though defaultUsers: true was set.

Now that my data was "backed up" within my cluster. Does anybody know if there a way to make the operator to actually create these default users and database?

I would appreciate any guidance or clarification on how the operator handles such scenarios. Let me know if you need more details about my setup.

klefevre avatar Jan 17 '25 16:01 klefevre

You want to create them only on the standby? Would not work because it‘s read-only.

FxKu avatar Oct 27 '25 06:10 FxKu