LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-07-2011, 09:51 PM   #1
adventuremalcolm
LQ Newbie
 
Registered: Apr 2011
Posts: 6

Rep: Reputation: 0
PostgreSQL: location of DB files


I want to keep my Postgresql database files on a separate volume from the OS files. I have a 2TB disc which I plan to mount to the location where PostgreSQL keeps it's files. I have assumed it is at /var/lib/postgresql/8.x/.

My problem is, when I mount a blank volume to that location, I can still see the default database files (postgres, template0 and template1) using psql. If the volume is blank, these shouldn't be there.

Further, I create a database, say "test1" in psql. When I then check the contents of my disc, there is nothing there.

This all means to me that postgresql is actually storing its files somewhere else. Would anybody know where that might be?
 
Old 10-07-2011, 10:23 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Create a new database in psql and then find all files modified in the past 5 mins.
Code:
find / -mtime -0.003 -not -path '/proc*' -not -path '/sys*' 2> /dev/null
or past 2 min...
Code:
find / -mtime -0.001 -not -path '/proc*' -not -path '/sys*' 2> /dev/null
The followin excludes the paths /proc and /sys
Code:
-not -path '/proc*' -not -path '/sys*'
SAM

Last edited by sag47; 10-07-2011 at 10:38 PM.
 
Old 10-09-2011, 08:50 PM   #3
adventuremalcolm
LQ Newbie
 
Registered: Apr 2011
Posts: 6

Original Poster
Rep: Reputation: 0
You're a Wizard, SAM!

Thanks for the excellent idea. I do in fact find a bunch of files changed in

/var/lib/postgresql/8.4/main/base/

... which I must assume are those for the test db I just created.

From here, I guess I'll run through the whole mount operation, create another test DB and see if the files for that show up on the mounted volume.

Thanks again,
Malcolm
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing text files with information from PostgreSQL DB aocferreira Programming 2 05-17-2011 08:12 AM
location of c header files neveser Linux - Newbie 18 02-01-2011 01:30 AM
moving files from a location to other, preventing to move incomplete files pogo123 Programming 8 11-14-2008 06:21 AM
moving files from a location to other, preventing to move incomplete files pogo123 Linux - Newbie 2 11-13-2008 01:57 PM
PostgreSQL database replication just by transfering/mirroring the files saumitra Programming 6 03-07-2007 05:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration