3

One of my Postgres databases is named entirely in upper-case, and a new bit of software needs to see it in lower-case. I've tried renaming it, but unfortunately that breaks the huge multitude of things that already rely on it being in upper-case (as they've got quotes in the connection string so need it in upper case). Going through and fixing those would be a risky, mammoth undertaking as there is nobody in the company left who originally created the database and all the things that rely on it, and documentation is scarce.

As such, I've come to the conclusion that the best way forwards is to leave the existing database as it is, but to try and have it available by two names - its original name, and a new name. I would imagine just about everyone here already knows of something like this anyway, but I'm relatively new. I've seen terms like alias and synonym in my Googling.

However, I don't believe either of these can be done to an entire database (if I'm wrong then I would be very happy with some information to go on). I've also tried creating an empty database (with the nice new lower-case name) and creating simple views to the original's tables, but of course views don't generally go cross-database.

Anyone got any ideas?

EDIT - also quickly tried dblink, which looks like it could do the job. Its an unknown function, so I'm guessing the version of postgres we're running is old. May see if we can upgrade it.

user25730
  • 131
  • 2

0 Answers0