Editing Database Schema
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
[[wikipedia:Database schema]] are analogous to [[directories]] at the operating system level, except that schemas cannot be nested. <ref>https://www.postgresql.org/docs/current/ddl-schemas.html</ref> | [[wikipedia:Database schema]] are analogous to [[directories]] at the operating system level, except that schemas cannot be nested. <ref>https://www.postgresql.org/docs/current/ddl-schemas.html</ref> | ||
+ | |||
+ | |||
Typical schemas usage scenarios <ref> https://www.postgresql.org/docs/current/ddl-schemas.html</ref>: | Typical schemas usage scenarios <ref> https://www.postgresql.org/docs/current/ddl-schemas.html</ref>: | ||
* To allow many users to use one database without interfering with each other. | * To allow many users to use one database without interfering with each other. | ||
Line 5: | Line 7: | ||
* Third-party applications can be put into separate schemas so they do not collide with the names of other objects. | * Third-party applications can be put into separate schemas so they do not collide with the names of other objects. | ||
− | |||
− | |||
− | |||
Grant examples on schemas: | Grant examples on schemas: | ||
Line 14: | Line 13: | ||
* <code>[[GRANT USAGE ON]] [[SCHEMA]] your_schema TO [[GROUP]] your_group;</code> | * <code>[[GRANT USAGE ON]] [[SCHEMA]] your_schema TO [[GROUP]] your_group;</code> | ||
+ | |||
+ | |||
+ | [[PostgreSQL]]: | ||
* Show/List [[schema]]s: | * Show/List [[schema]]s: | ||
** <code>select [[nspname]] from [[pg_catalog]].pg_namespace;</code> | ** <code>select [[nspname]] from [[pg_catalog]].pg_namespace;</code> | ||
** <code>select [[schema_name]] from [[information_schema]].schemata;</code> <ref>https://dba.stackexchange.com/questions/40045/how-do-i-list-all-schemas-in-postgresql</ref> | ** <code>select [[schema_name]] from [[information_schema]].schemata;</code> <ref>https://dba.stackexchange.com/questions/40045/how-do-i-list-all-schemas-in-postgresql</ref> | ||
** <code>[[\dn]]</code> | ** <code>[[\dn]]</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[ | + | [[GRANT SELECT]] ON ALL TABLES IN [[SCHEMA]] [[public]] TO xxx; |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Related == | == Related == | ||
Line 40: | Line 31: | ||
* [[PostgreSQL: catalogs]] | * [[PostgreSQL: catalogs]] | ||
* <code>[[GRANT SELECT]]</code> | * <code>[[GRANT SELECT]]</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
− | * {{ | + | * {{PostgreSQL}} |
[[Category:PostgreSQL]] | [[Category:PostgreSQL]] |
Advertising: