Обсуждение: What's the point of multiple databases?
I hope I don't regret too much not waiting for morning and a fresh take on all this. :-) So I've got this nice new postgreSQL and it seems to be working nicely. I've setup a user identity with create database priviliges, and set out to setup a couple databases for separate projects I want to work on. That's what separately named databases are for, right? Well, maybe it's just a quirk of the utilities (psql and pgaccess), but it seems that no matter which database I open, I can see and access all the tables in any database created by this user. This seems, well, wrong. This is from the Debian "potato" install, which is based on 6.5.3. All I need is a sanity check, please: is this doable, or is there no point in setting up more than one database per postgres user? Thanks!
Martin Maney wrote: > > I hope I don't regret too much not waiting for morning and a fresh take on > all this. :-) > > So I've got this nice new postgreSQL and it seems to be working nicely. > I've setup a user identity with create database priviliges, and set out to > setup a couple databases for separate projects I want to work on. That's > what separately named databases are for, right? > > Well, maybe it's just a quirk of the utilities (psql and pgaccess), but it > seems that no matter which database I open, I can see and access all the > tables in any database created by this user. This seems, well, wrong. > > This is from the Debian "potato" install, which is based on 6.5.3. All I > need is a sanity check, please: is this doable, or is there no point in > setting up more than one database per postgres user? First, show us what you're seeing. Next, if you create something in the template1 DB, then it will appear in all newly created databases... HTH, -- Martijn van Oosterhout <kleptog@cupid.suninternet.com> http://cupid.suninternet.com/~kleptog/
I kind of wondered about the visibility thing as well....but never got around to really sorting through it. What we use it for is CGI script privileges. Each user in effect is a database "realm" and therefore allows you to have tables with the same names as tables in other 'realms' Barring a full blown permissions system (users, groups, read/write/exec privs) i'm not sure what the postgresql roadmap has in store -duck On Tue, 27 Jun 2000, Martin Maney wrote: > I hope I don't regret too much not waiting for morning and a fresh take on > all this. :-) > > So I've got this nice new postgreSQL and it seems to be working nicely. > I've setup a user identity with create database priviliges, and set out to > setup a couple databases for separate projects I want to work on. That's > what separately named databases are for, right? > > Well, maybe it's just a quirk of the utilities (psql and pgaccess), but it > seems that no matter which database I open, I can see and access all the > tables in any database created by this user. This seems, well, wrong. > > This is from the Debian "potato" install, which is based on 6.5.3. All I > need is a sanity check, please: is this doable, or is there no point in > setting up more than one database per postgres user? > > Thanks! > ----------------------------------------------------------------------------- david@backpack.com BackPack Software, Inc. www.backpack.com +1 651.645.7550 voice "Life is an Adventure. +1 651.645.9798 fax Don't forget your BackPack!" -----------------------------------------------------------------------------
On Thu, Jun 29, 2000 at 11:18:09PM +1000, Martijn van Oosterhout wrote: > First, show us what you're seeing. Next, if you create something > in the template1 DB, then it will appear in all newly created > databases... Thanks to everyone who responded. I can't figure out how it happened, but apparently the "manufacturer" table had gotten created in the template database... but it was created AFTER at least one of the databases had been itself created, so why was the table copied to that one? Oh well, at least after dropping the unwanted copies it's all working as I had expected it should.