Postgresql – Giving a database an alias in postgres

databasepostgresql

Is there any way to give a postgres database an alias?

Essentially, I need a single database to operate with two names, so that I could make queries to, say, DB_ALPHA and DB_ONE and they'd have the exact same effect. I accomplished this in MySQL by putting a symbolic link to the database in the same directory. I haven't been able to find an equivalent of this solution in postgres.

I appreciate the help! Thanks!

Best Answer

You cannot create an alias to a schema or database since the Schemaname / DBname is used internally as primary key for the tables pg_namespace and pg_database.