Re: Creating a table

From: "Albin, Lloyd P" <lalbin(at)scharp(dot)org>
To: "Basil Bourque" <basil(dot)list(at)me(dot)com>, <seapug(at)postgresql(dot)org>
Subject: Re: Creating a table
Date: 2010-09-16 22:38:07
Message-ID: D780EAC3ADA31F488BCA74ECCD5B717E062EE36D@ISIS.fhcrc.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: seapug

Basil,

The public schema everybody has access to. You can create additional
schema where you limit the access to specific users. Some people use
schema like databases where an application can only access their schema
along with any generic data in the public schema. But unlike separate
databases, you can do queries across schema's if you have privileges to
both schemas and the data you want to query. For learning you can create
all your queries in public and then you just use the table/view names in
your queries. If you use schemas other than public, then you need to use
schema.table or schema.view in your queries so that it knows where to
look for them. If you want a particular connection to not need to use
the schema names, you can have you application set the path by using the
set search_path parameter.

The pg_temp schemas are created for each login and hold thing like temp
tables if you create them.

Basically all the schemas you can ignore except for the public one. The
program that I use hides all those system schema's unless I check that I
want to see them. This makes my view of the schema's cleaner.

For an administrator or doing advanced queries, the extra schemas are
very helpful but for a beginning user it is sometime easier to start
learning without them.

I was also demoing DbVisualizer and that is also available for the mac.
http://www.dbvis.com/products/dbvis/download/

Toast Info
http://www.postgresql.org/docs/9.0/static/storage-toast.html

pg_temp Info
http://www.postgresql.org/docs/9.0/static/runtime-config-client.html

pg_catalog System Catalogs
http://www.postgresql.org/docs/9.0/static/catalogs-overview.html
http://www.postgresql.org/docs/9.0/static/views-overview.html

information_schema another very interesting area
http://www.postgresql.org/docs/9.0/static/information-schema.html

search_path Parameter (See examples)
http://www.postgresql.org/docs/9.0/static/sql-set.html

Lloyd

-----Original Message-----
From: seapug-owner(at)postgresql(dot)org [mailto:seapug-owner(at)postgresql(dot)org]
On Behalf Of Basil Bourque
Sent: Wednesday, September 15, 2010 2:49 PM
To: seapug(at)postgresql(dot)org
Subject: [seapug] Creating a table

This newbie thanks you for helping me last night with my questions on
creating a database.

I wrote one blog entry about my experience installing Postgres 9.0rc1 on
my Mac. I plan to write another with the lessons you taught me last
night.
http://crafted-software.blogspot.com/2010/09/installing-postgres.html

Now I need help creating a table. In pgAdmin, I see 4 schema in my newly
created database. Do I create my tables under the schema named "public"?
I can click to get a context menu with a "New Table..." menu item. I'm
just not sure if that is the right place for my tables.

The other Schemas are "pg_toast", "pg_toast_temp_1", and "pg_temp_1" --
Do I ignore these?

Likewise, do I ignore the two "Catalog" items?

I've looked but can't find docs for these kinds of newbie questions in
the pgAdmin help, FAQs, or the postgres docs.
http://www.postgresql.org/docs/
Please point me to such docs if they exist.

--Basil Bourque

--
Sent via seapug mailing list (seapug(at)postgresql(dot)org) To make changes to
your subscription:
http://www.postgresql.org/mailpref/seapug

In response to

Responses

Browse seapug by date

  From Date Subject
Next Message Basil Bourque 2010-09-27 02:22:27 Re: Creating a table
Previous Message Basil Bourque 2010-09-15 21:49:20 Creating a table