Unix Technical Forum

Newbie questions (pg_global, tablespace, pg_temp, ...)

This is a discussion on Newbie questions (pg_global, tablespace, pg_temp, ...) within the Pgsql General forums, part of the PostgreSQL category; --> Hello, I'm new to postgreSQL (not databases) and trying to find my way arouund. Have a couple of questions: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 02:25 PM
Alexi Gen
 
Posts: n/a
Default Newbie questions (pg_global, tablespace, pg_temp, ...)

Hello,

I'm new to postgreSQL (not databases) and trying to find my way arouund.
Have a couple of questions:

(a) In which dir is the pg_global stored?
Is it "C:\Program Files\PostgreSQL\8.2\data\global"?

(b) Why is the pg_tablespace.spclocation column=null for pg_default &
pg_global?

(c) When creating an object - if the tablespace attribute is not specified -
it is resolved as follows:
Index - Parent Table on which the index is being created.
Table - Tablespace of the database in which the table is being created.
Database - Tablespace of the template from which this database was created
(Ex: template1).

If the above is the method by which the tablespace name is resolved, when
does the default_tablespace variable get used?
Or Will the above come into the picture if default_tablespace=NULL?

(d)
The following objects are shared between all databases in a cluster.
pg.catalog.pg_group: List of user groups (View).
pg.catalog.pg_shadow: List of valid users. (View)
pg.catalog.pg_database: List of databases in the cluster. (Table)
pg.catalog.pg_tablespace: List of tablespaces. (Table)

There are 33 tables & 33 Views in the pg_catalog schema.
Are there any other tables & views that are common to all databases in a
cluster?
Why have cluster common objects sitting in each database in the cluster?
How can we differentiate between objects in pg_catalog?
Those that are specific to the database and those that are common to the
cluster?

(e) Can someone please point me to a document/URL that has information about
using temp tables in postgreSQL?
I have already read material that is available in the official PostgreSQL
documentation.
Want something more - the inner workings, pg_temp*, etc..


Cheers!
sqlcatz

__________________________________________________ _______________
Always wanted to be a writer? Here's your chance!
http://content.msn.co.in/Contribute/Default.aspx


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 02:26 PM
Martijn van Oosterhout
 
Posts: n/a
Default Re: Newbie questions (pg_global, tablespace, pg_temp, ...)

On Wed, Jan 17, 2007 at 07:02:13PM +0530, Alexi Gen wrote:
> Hello,
>
> I'm new to postgreSQL (not databases) and trying to find my way arouund.
> Have a couple of questions:
>
> (a) In which dir is the pg_global stored?
> Is it "C:\Program Files\PostgreSQL\8.2\data\global"?


Yes.

> (b) Why is the pg_tablespace.spclocation column=null for pg_default &
> pg_global?


Because they're fixed by the base location of the cluster, they don't
need to specified.

> (c) When creating an object - if the tablespace attribute is not specified
> - it is resolved as follows:
> Index - Parent Table on which the index is being created.
> Table - Tablespace of the database in which the table is being created.
> Database - Tablespace of the template from which this database was created
> (Ex: template1).
>
> If the above is the method by which the tablespace name is resolved, when
> does the default_tablespace variable get used?
> Or Will the above come into the picture if default_tablespace=NULL?


It's the default if nothing has been specified. The docs say quite
clearly that the default_tablespace GUC overrides those rules you gave.

> (d)
> The following objects are shared between all databases in a cluster.
> pg.catalog.pg_group: List of user groups (View).
> pg.catalog.pg_shadow: List of valid users. (View)
> pg.catalog.pg_database: List of databases in the cluster. (Table)
> pg.catalog.pg_tablespace: List of tablespaces. (Table)
>
> There are 33 tables & 33 Views in the pg_catalog schema.
> Are there any other tables & views that are common to all databases in a
> cluster?


Anything in the pg_global tablespace.

> Why have cluster common objects sitting in each database in the cluster?


They only exist once, they are just visible from each database.

> How can we differentiate between objects in pg_catalog?


By OID? I'm not sure of the question.

> Those that are specific to the database and those that are common to the
> cluster?


The stuff that's global is in pg_global, everything else is seperate.

> (e) Can someone please point me to a document/URL that has information
> about using temp tables in postgreSQL?
> I have already read material that is available in the official PostgreSQL
> documentation.
> Want something more - the inner workings, pg_temp*, etc..


The docs cover all this, but you'll have to go to the section dealing
with technical details.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFrnCPIB7bNG8LQkwRAj8iAJ4xPFiyLJ9zWXFSsP9Z3X RbZElKqQCfez0V
wQSIpmA9VrM8dyd1fGXBPkQ=
=TSls
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:12 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com