HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

Concept of Schema in PostgreSQL

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlconceptschema

Problem

I am not able to understand concept and usage of schema in PostgreSQL. I have no idea how it can affect my database design.
Why should I use it?

Can it affect me in future if I decide to not think about them right now and worry about them later?

Explanation with an example will be nice.

Solution

Schemas in postgres are used mostly for namespacing and sometimes for security.

Namespacing because two objects can have the same name in different schemas, and are then referenced by schema.object notation - especially useful in conjunction with search_path (many contrib modules do this, eg xml2). Security because you can now do grant ... on all tables in schema.

Context

StackExchange Database Administrators Q#7092, answer score: 13

Revisions (0)

No revisions yet.