Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a 'Schema' in PostgreSQL? [closed]

As the question clearly indicates, what is actually a Schema in PostgreSQL that I see in the top level of the hierarchy in pgAdmin(III)?

like image 473
Sazid Avatar asked Oct 25 '13 02:10

Sazid


1 Answers

Ok, I'm answering my own question just to clarify any other people (who do not have time to read docs or want a more simplified version):

You can think of a Schema as a namespace/package (just like in Java or C++). For example, let us assume mydb is the name of our database, A and B is the name of two different schemas which are present in the same database (mdb).

Now, we can use the same table name in two different schemas in the same single database:

mydb -> A -> myTable
mydb -> B -> myTable

Hope, that clarifies your answer. For more detail: PostgreSQL 9.3.1 Documentation - 5.7. Schemas

like image 178
Sazid Avatar answered Sep 22 '22 10:09

Sazid