dbTalk Databases Forums  

stupid question

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss stupid question in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bryan Irvine
 
Posts: n/a

Default stupid question - 12-26-2003 , 12:07 PM






Maybe this sounds stupid, but, where is the actual database file? I'm
sure there's a file that is the actual DB, but what/where?

--Bryan


---------------------------(end of broadcast)---------------------------
TIP 3: 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


Reply With Quote
  #2  
Old   
Marc G. Fournier
 
Posts: n/a

Default Re: stupid question - 12-26-2003 , 12:15 PM






On Fri, 26 Dec 2003, Bryan Irvine wrote:

Quote:
Maybe this sounds stupid, but, where is the actual database file? I'm
sure there's a file that is the actual DB, but what/where?
nope ... depending on what version of postgresql you are running, the
newer ones store it in ${PGDATA}/base/<OID>, under which, there are
indivicudal files for system tables, indices and tables themselves ...


----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy (AT) hub (DOT) org Yahoo!: yscrappy ICQ: 7615664

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
  #3  
Old   
Larry Rosenman
 
Posts: n/a

Default Re: stupid question - 12-26-2003 , 12:18 PM





--On Friday, December 26, 2003 10:07:52 -0800 Bryan Irvine
<bryan.irvine (AT) kingcountyjournal (DOT) com> wrote:

Quote:
Maybe this sounds stupid, but, where is the actual database file? I'm
sure there's a file that is the actual DB, but what/where?

all the files under the data/ directory are the database.

LER

Quote:
--Bryan


---------------------------(end of broadcast)---------------------------
TIP 3: 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



--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler (AT) lerctr (DOT) org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/7Ht6rRNGhTxJvdYRAqOcAJ9PFB5wvGiz0X1xZH7xh518Z9D4FA CaA7jq
8g7IyTtA3VhLKs99HaPOrZE=
=Vp6C
-----END PGP SIGNATURE-----



Reply With Quote
  #4  
Old   
rhkelly
 
Posts: n/a

Default Re: stupid question - 12-31-2003 , 04:09 PM



Quote:
On Fri, 26 Dec 2003, Bryan Irvine wrote:

Maybe this sounds stupid, but, where is the actual database file? I'm
sure there's a file that is the actual DB, but what/where?


nope ... depending on what version of postgresql you are running, the
newer ones store it in ${PGDATA}/base/<OID>, under which, there are
indivicudal files for system tables, indices and tables themselves ...
Is there a Postgress documentation section somewhere that
would tell me the following:

1) the exact correspondence of the files and tables, indices etc.

2) what are the safe filesystem operations on those files
(individual file backup/recovery, moving of files
between different postgress computers/installations etc.?

TIA.
Roger



---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
  #5  
Old   
Michael Glaesemann
 
Posts: n/a

Default Re: stupid question - 12-31-2003 , 05:37 PM



Hello, fellow myrealbox user!

On Dec 31, 2003, at 4:09 PM, rhkelly wrote:

Quote:
On Fri, 26 Dec 2003, Bryan Irvine wrote:

Maybe this sounds stupid, but, where is the actual database file?
I'm
sure there's a file that is the actual DB, but what/where?
nope ... depending on what version of postgresql you are running, the
newer ones store it in ${PGDATA}/base/<OID>, under which, there are
indivicudal files for system tables, indices and tables themselves ...

Is there a Postgress documentation section somewhere that
would tell me the following:

1) the exact correspondence of the files and tables, indices etc.

2) what are the safe filesystem operations on those files
(individual file backup/recovery, moving of files
between different postgress computers/installations etc.?
Not to be contrary, but why would you want to know this? The beauty of
using a DBMS is to take care of all of that. Unless you're doing some
kind of serious database recovery, I'd say you're better of leaving the
/data directory alone and let PostgreSQL handle that for you. My
admittedly inexperienced opinion is that I'm much more likely to do
serious damage to the system trying to back up individual files rather
than the database (or database cluster) as a whole. And for moving an
database between PostgreSQL installations or backup, I'd use the
pg_dump/pg_restore commands, which are used with a running postmaster.

That said, I have heard of people shutting down the postmaster and
using cp to copy the whole directory.

Sorry if this comes off a little strong. I don't mean to imply your
questions are stupid. It comes from having more trust in PostgreSQL
(and its developers) to handle these things than anyone other than a
very experienced PostgreSQL DBA to mess with anything in the /data
directory. And for what you've described, I think there are safer, more
reliable methods available.

Michael Glaesemann
grzm myrealbox com


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
  #6  
Old   
rhkelly
 
Posts: n/a

Default Re: stupid question - 01-01-2004 , 11:37 AM



Michael Glaesemann wrote:

Quote:
Hello, fellow myrealbox user!

...rhkelly wrote:


Maybe this sounds stupid, but, where is the actual database file?
I'm sure there's a file that is the actual DB, but what/where?


Is there a Postgress documentation section somewhere that
would tell me the following:

1) the exact correspondence of the files and tables, indices etc.

2) what are the safe filesystem operations on those files
(individual file backup/recovery, moving of files
between different postgress computers/installations etc.?


Not to be contrary, but why would you want to know this?
Thanks for your comments Michael; to answer your question:

So that I can put the system into some 'partial/previous'
state in a manner which Postgress itself does not support
and with a high degree of confidence that my actions had
the desired effect (and no catastrophic side-effects .
I felt it would be a misappropriation of the attention and
patience of the list to get into details; I only humbly
asked for help with the documentation in a thread that was
'on topic' i.e., something I thought *ought to be*
documented (and - at least as fas as item '1' above is
concerned - for puposes other than mine!), but was unable
to find. I'll keep looking.

Roger




---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
  #7  
Old   
Tom Lane
 
Posts: n/a

Default Re: stupid question - 01-01-2004 , 12:15 PM



rhkelly <rhkelly (AT) myrealbox (DOT) com> writes:
Quote:
Michael Glaesemann wrote:
2) what are the safe filesystem operations on those files
(individual file backup/recovery, moving of files
between different postgress computers/installations etc.?

Not to be contrary, but why would you want to know this?

So that I can put the system into some 'partial/previous'
state in a manner which Postgress itself does not support
You can't. The connections between data files, xlog, and clog
are sufficiently critical that you cannot hope to take some files
out of an installation and put them into another one (nor into
an earlier or later state of the same installation).

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
  #8  
Old   
rhkelly
 
Posts: n/a

Default Re: stupid question - 01-01-2004 , 02:14 PM



Tom Lane wrote:

Quote:
rhkelly <rhkelly (AT) myrealbox (DOT) com> writes:

Michael Glaesemann wrote:
1) the exact correspondence of the files and tables...
2) what are the safe filesystem operations...

Not to be contrary, but why would you want to know this?

So that I can put the system into some 'partial/previous'
state in a manner which Postgress itself does not support

You can't. The connections between data files, xlog, and clog...
May I suggest we take two steps back...

I was simply inquiring about what I consider to be an indispensible
element of documentation for *any* application - i.e., the content
and format of the files in which the application stores the data.

I was unable to find it and asked for help.

Roger



---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
  #9  
Old   
Tom Lane
 
Posts: n/a

Default Re: stupid question - 01-01-2004 , 02:32 PM



rhkelly <rhkelly (AT) myrealbox (DOT) com> writes:
Quote:
I was simply inquiring about what I consider to be an indispensible
element of documentation for *any* application - i.e., the content
and format of the files in which the application stores the data.
[ Raises eyebrow... ] I'm not aware of any complex application in which
file format details are considered an indispensable part of the user-level
documentation. Do Word, Photoshop, Outlook, etc provide that info?

Where you want to be looking is at the developer docs, eg
http://developer.postgresql.org/docs/postgres/page.html
and at the source code --- probably
src/include/storage/bufpage.h
src/include/access/htup.h
are good starting points.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
  #10  
Old   
rhkelly
 
Posts: n/a

Default Re: stupid question - 01-01-2004 , 03:32 PM



Tom Lane wrote:

Quote:
rhkelly <rhkelly (AT) myrealbox (DOT) com> writes:

I was simply inquiring about what I consider to be an indispensible
element of documentation...

[ Raises eyebrow... ] I'm not aware of any complex application in which
file format details are considered an indispensable part of the user-level
documentation. Do Word, Photoshop, Outlook, etc provide that info?
Which could explain why I don't use either Word or Outlook, and why
I store the images I operate on with Photoshop as .png's

But seriously - thank you: your poinetrs below are *much* appreciated.
kind regards, RK

Quote:
Where you want to be looking is at the developer docs, eg
http://developer.postgresql.org/docs/postgres/page.html
and at the source code --- probably
src/include/storage/bufpage.h
src/include/access/htup.h
are good starting points.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.