Re: schema support, was Package support for Postgres
От
Peter Eisentraut
Тема
Re: schema support, was Package support for Postgres
Дата
Msg-id
Pine.LNX.4.30.0110250020290.647-100000@peter.localdomain
Ответ на
Re: schema support, was Package support for Postgres (Bill Studenmund)
Список
Дерево обсуждения
Re: schema support, was Package support for Postgres "Ross J. Reedstrom" <reedstrm@rice.edu>
Bill Studenmund writes: > > Because SQL says so. All objects in a schema belong to the owner of the > > schema. In simple setups you have one schema per user with identical > > names. This has well-established use patterns in other SQL RDBMS. > > Then implimenting schemas will cause a backwards-incompatabile change > regarding who can add/own functions (and operators and ..). > > Mainly because when we introduce schemas, all SQL transactions will have > to be performed in the context of *some* schema. I think "DEFAULT" was the > name you mentioned for when there was no schema matching the username. As > "DEFAULT" (or whatever we call it) will be made by the PG super user (it > will actually be added as part of initdb), then that means that only the > super user will own functions. If you want to own the function you should create it in your schema. If you want to create a function and let someone else own it, then ask someone else for write access to their schema. (This should be a rare operation and I don't think SQL provides for it, so we can ignore it in the beginning.) If there is no schema you have write access to then you cannot create things. People have been dying for that kind of feature, and schemas will enable us to have it. Think about it this way: In its simplest implementation (which is in fact the Entry Level SQL92, AFAIR), a schema can only have the name of the user that owns it. I suspect that this is because SQL has no CREATE USER, so CREATE SCHEMA is sort of how you become a user that can do things. At the same time, schemas would space off the things each user creates, and if you want to access someone else's stuff you have to prefix it with the user's name .
В списке pgsql-hackers по дате отправления