Create new db in a different drive

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

Re: Create new db in a different drive

Postby Zen_Approach » Thu Mar 13, 2008 11:05 am

Ok, I am trying to install PostgreSQL on my external hard drive and keep the database there. I basically started from scratch, but PostgreSQL wouldn't let me install the data folder on the external hard drive because apparently the filing system was not correct.

Does anybody know if it is possible to store a PostgreSQL database on an external hard drive? I don't mind starting a database
from scratch.

If so some instructions for someone fairly helpless with computers would be really appreciated. BTW I am using PTv2, not 3.

Thanks!
Zen_Approach
 
Posts: 3
Joined: Wed Mar 12, 2008 12:24 am

Re: Create new db in a different drive

Postby omaha » Sun Mar 16, 2008 5:24 am

Hi, i am trying to do this, but i am totally retarded

When i create the tablespace, i get the message WARNING: nonstandard use of \\ in a string literal. Hint Use the escape string syntax for backslashes, eg D'\\'

Is this normal?

When i then type CREATE DATABASE pt3_beta3_newdb TABLESPACE spare_disk;

I get ERROR: could not create directory"pg_tablespc/74964/85935": No such file or directory.

Now, i have a couple of dbs, and one is named partypoker, and HU FUll TILT, and the one i first made seems to be called PT3_2008_03_14_203606, even though i thought i had called it something else. When i try to use any of these names instead of 'newdb' i seem to get the same error message

All help for this retardo much appreciated!
omaha
 
Posts: 215
Joined: Sat Dec 22, 2007 8:39 pm

Re: Create new db in a different drive

Postby _dave_ » Tue Mar 18, 2008 9:48 pm

Hi,

[quotezk3]
When i create the tablespace, i get the message WARNING: nonstandard use of \\ in a string literal. Hint Use the escape string syntax for backslashes, eg D'\\'

Is this normal?
[/quotezk3]

Do not worry about WARNINGs. I used an 8.0 format command in the OP, thanks to an old postgres version on my windows machine. if it says "CREATE TABLESPACE" on a line all alone, the command worked.

[quotezk3]
When i then type CREATE DATABASE pt3_beta3_newdb TABLESPACE spare_disk;

I get ERROR: could not create directory"pg_tablespc/74964/85935": No such file or directory.

Now, i have a couple of dbs, and one is named partypoker, and HU FUll TILT, and the one i first made seems to be called PT3_2008_03_14_203606, even though i thought i had called it something else. When i try to use any of these names instead of 'newdb' i seem to get the same error message
[/quotezk3]

You *do not* want to be using already existing database names in any of these commands - they are for creating entirely new databases. One cannot to my knowledge easily "move" a database to a new tablespace, only create new ones.

the ERROR - sounds like you have not actually creatyed a new tablespace - or at least not one called "spare_disk".

if you execute the command:
[codezk3]\db[/codezk3]
at the psql console as user postgres (does not matter which database you are connected to), it should give you a list of tablespaces you have created - mine looks like this:
[codezk3]postgres=# \db
List of tablespaces
Name | Owner | Location
------------+----------+-----------------------
memstick | postgres | /mnt/memstick/pg_data
pg_default | postgres |
pg_global | postgres |
sata30 | postgres | /mnt/sata30/pg_data
(4 rows)
[/codezk3]

Can you do this and post what you get?

Otherwise, could you list all the commands *exactly as you have typed them*, and the resulting output please?
_dave_
 
Posts: 1147
Joined: Sun Dec 09, 2007 6:19 pm

Re: Create new db in a different drive

Postby camojy » Sat Mar 22, 2008 7:51 pm

Hello,

I want to move my database from C: to D:.

tried to follow the tutorial but it isn't working at all. I understand nothing about CMD, database and SQL.

My database is not named as in the example but that doesn't change a thing.

Where is my problem.
http://pix.nofrag.com/2/3/e/7837d414ff4 ... 403ca.html

Thx a lot.
camojy
 
Posts: 6
Joined: Sat Mar 22, 2008 6:14 am

Re: Create new db in a different drive

Postby _dave_ » Sat Mar 22, 2008 8:07 pm

You have two problems.

Firstly, your CREATE TABLESPACE command failed because of a permissions error - are you on XP Pro? Check my instructions to set user postgres to have full access to the D:\pg_data folder.

Secondly, something has happened with the CREATE DATABASE - I guess it has changed the case of something - try \connect with the database name double quoted - or type [code7si]\l[/code7si] at the psql console to see a list of available database names. This doesn't really matter, since the new database you created is not on the new tablespace anyhow (as it failed, and you didn't list it in the create database command).
_dave_
 
Posts: 1147
Joined: Sun Dec 09, 2007 6:19 pm

Re: Create new db in a different drive

Postby camojy » Sat Mar 22, 2008 10:39 pm

Thx for your answer.

I'm on a french version of XP Home.

It seemed to work a little. I succesfully created a new database, but when i choose the new one in pokertracker, it's the c: folder which is expanding and not the d: :|

I'm going to uninstall everything and try again tomorow (it's 3:30am and i'm really tired now :D )

I'll keep you updated.
camojy
 
Posts: 6
Joined: Sat Mar 22, 2008 6:14 am

Re: Create new db in a different drive

Postby camojy » Sun Mar 23, 2008 5:20 am

Ok I'm back !

I re-installed everything and it's working I guess.

Bhe only problem now is that I'm connected to my new database on D:, i can import Hand Histories ok, my pg_data grew up from 5Mo to 2GO :D .

But when the import is completed and the clustering is done, nothing appears on my Texas Holdem tab.

Where are my stats !?

The for your help.
camojy
 
Posts: 6
Joined: Sat Mar 22, 2008 6:14 am

Re: Create new db in a different drive

Postby WhiteRider » Sun Mar 23, 2008 5:24 am

[quote="camojy"xce]But when the import is completed and the clustering is done, nothing appears on my Texas Holdem tab.

Where are my stats !?[/quotexce]
Did you click "Refresh"?
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Create new db in a different drive

Postby camojy » Sun Mar 23, 2008 5:59 am

Lol...

i'm really a donk :D

This is the first time I use Poker Tracker, I had Poker Office before, and it seems that PT is 100000000000x faster !

Looking forward to buy it as soon as possible.

i'm gonna watch the tutorial video they made on stoxpoker for PT3 Beta.

Sorry for my stupids questions.

Thx a lot.
camojy
 
Posts: 6
Joined: Sat Mar 22, 2008 6:14 am

Re: Create new db in a different drive

Postby G3K0 » Sat Mar 29, 2008 9:06 am

Hey all - [size=150kqa][color=#0000FFkqa][bkqa]Vista & PgAdmin III Response[/bkqa][/colorkqa][/sizekqa]
[color=#4000FFkqa]
[ikqa]Firstly some sychophantic-ishness out of the way: love the new forum, PT3 Beta (where's me omaha boss? more than happy to Alpha stress test ) . Might I suggest you guys start wiki'ing this to save on the Q&A for set-ups?
[/ikqa][/colorkqa]

So...AMD 64 x 2; Vista HP SP1; PostgreSQL 3.1.xx.; PT3 Beta 6; PTO 1.13.00

D:\pg_data property \ security commands run all as the original instructions.

PSQL to 'postgres': Had a few issues here

1) Instructions on the Schema

[quotekqa]3: For conveniences sake, we should copy the database schema to save typing later. This is optional, but do it anyway. Using Windows Explorer, navigate to "C:\Program Files\PokerTracker3\Data\Schemas". There should be a single file in here, "schema.postgres.sql" - copy it, and paste in the root of D:\.

Now you should have two things in D:\ - a folder (with postgres user having full access control) - and a copy of the PT3 schema. This is the end of preparation, let us now get it done![/quotekqa]

Yeah, shoot me for not reading down to page 4 of the thread for NOT copying the schema into the 'd:\pg_data' folder until AFTER creating the db...but move the schema in before the :

[quotekqa]\i schema.postgres.sql[/quotekqa]

command.

For some reason my system baulked at the \connect dbname_in_here command line. I ran a few alternatives, egooglied a bit but no joy so I went to the PgAdmin III tool and did everything from there.
[size=150kqa]
[color=#0000BFkqa][ukqa][bkqa]PgAdmin III Instructions:[/bkqa][/ukqa][/sizekqa][/colorkqa]

1) Open PgAdmin III and connect to your server; expand the tree view
2) Right Click the Tablespaces and select New Tablespace

http://i19.photobucket.com/albums/b185/ ... extual.jpg

Set up the tablespace

http://i19.photobucket.com/albums/b185/ ... alogue.jpg

3) Exit PT3, ensure that PgAdmin III is not connected to your default PT3 db (may need to exit, restart, reconnect to default server and NOT connect to PT3 db)

4) Right Click database parent and select New Database

http://i19.photobucket.com/albums/b185/ ... extual.jpg

Set up the database using your orignial PT3 database as a template, this will copy your schema.

Important: set the code to SQL Ascii

http://i19.photobucket.com/albums/b185/ ... alogue.jpg

http://i19.photobucket.com/albums/b185/ ... review.jpg

Voila: you can then follow the DB Management settings to configure PT3 to use this DB as your default.

<Mod, can you check and endorse?>
G3K0
 
Posts: 24
Joined: Fri Mar 28, 2008 8:39 pm

PreviousNext

Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 4 guests

cron
highfalutin