Skip site navigation (1) Skip section navigation (2)

Re: Schema Questions

From: "Guido Barosio" <gbarosio(at)gmail(dot)com>
To: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
Cc: operationsengineer1(at)yahoo(dot)com, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Schema Questions
Date: 2006-02-23 21:45:05
Message-ID: f7f6b4c70602231345s11bd9838r679b2e30f51156d7@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
A common production example on several databases that I manage (pretty
lammer, I admit):

Two schemas exists where:

schema A: the place where I write the data
schema B: a collection of views JUST READING schema A.

This allows me to create users and map them directly against the schema I
expect them to browse and use.

ie:

write_user: mapped against schema A
read_only_user: mapped against schema B

happy design!

g.-


On 2/23/06, Sean Davis <sdavis2(at)mail(dot)nih(dot)gov> wrote:
>
>
>
>
> On 2/23/06 12:06 PM, "operationsengineer1(at)yahoo(dot)com"
> <operationsengineer1(at)yahoo(dot)com> wrote:
>
> > hi all,
> >
> > i just read the pgsql manual schema section
> >
> > http://www.postgresql.org/docs/8.1/interactive/ddl-schemas.html
> >
> > and i have a couple questions.
> >
> > 1. the first reason listed for using schemas is...
> >
> > "To allow many users to use one database without
> > interfering with each other."
> >
> > i don't quite understand this statement.  does this
> > assume that users will be divided between schemas,
> > thereby reducing the load on a given schema?  i'd
> > appreciate it if someone could clarify what is meant
> > here.
>
> Not exactly.  It just means that one user can create a table called
> mytable
> and another user in a different schema can create a table called mytable,
> and they will both exist happily, as a simple example.
>
> > 2. would using schemas be a good approach to separate
> > out public data from private data?  for example, does
> > it make sense to create a schema for private data and
> > another for public data (with a different user)?
>
> Yep.  That could be done easily.
>
> Sean
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>       message can get through to the mailing list cleanly
>



--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------

In response to

pgsql-novice by date

Next:From: Michael FuhrDate: 2006-02-23 22:45:23
Subject: Re: check problem
Previous:From: operationsengineer1Date: 2006-02-23 19:21:58
Subject: Re: reinstallation of Posstgresql 8.0 program

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group