Re: SQL objects UNITs
От | Jim Nasby |
---|---|
Тема | Re: SQL objects UNITs |
Дата | |
Msg-id | 52B20365.1040704@nasby.net обсуждение исходный текст |
Ответ на | SQL objects UNITs (was: Extension Templates S03E11) (Dimitri Fontaine <dimitri@2ndQuadrant.fr>) |
Список | pgsql-hackers |
On 12/18/13, 4:22 AM, Dimitri Fontaine wrote: > ALTER UNIT name SET SCHEMA <new schema>; FWIW, with the "units" that we've developed we use schemas to differentiate between public objects and "internal" (privateor protected) objects. So single-schema stuff becomes a PITA. Of course, since extensions already work that way Isuppose that ship has sailed, but I thought I'd mention it. For those who are curious... we make the distinction of public/protected/private via schemas because we don't want generalusers to need to wade through that stuff when looking at objects. So the convention we settled on is that public objectsgo in one schema, protected objects go in a schema of the same name that's prepended with "_", and private objectsare in the protjected schema but also prepend "_" to their names. IE: CREATE SCHEMA awesome_feature; CREATE VIEW awesome_feature.have_some_data CREATE SCHEMA _awesome_feature; -- Protected / private stuff CREATE VIEW _awesome_feature.stuff_for_database_code_to_see_but_not_users CREATE FUNCTION _awesome_feature._do_not_run_this_function_anywhere_outside_of_awesome_feature() -- Jim C. Nasby, Data Architect jim@nasby.net 512.569.9461 (cell) http://jim.nasby.net
В списке pgsql-hackers по дате отправления: