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 vbpro7 » Fri Dec 05, 2008 6:50 pm

kraada wrote:CREATE TABLE NewDB USING TABLESPACE WhateverYouCalledItEarlier;


Ok, i'm not as savy using postgreSQL as you guys are, so let me get this straight.

DO i type
1a. CREATE TABLE 2008_DEC USING TABLESPACE spare_disk;

or

1b. CREATE DATABASE 2008_DEC TABLESPACE spare_disk;

Then afterwards i run all these commands?

2. \connect 2008_DEC
3. \cd E:
4. \i schema.postgres.sql
5. \q

Or is all of this wrong?
vbpro7
 
Posts: 49
Joined: Sun Feb 17, 2008 6:52 pm

Re: Create new db in a different drive

Postby kraada » Sat Dec 06, 2008 9:42 am

The way I wrote it was clearly misleading; the correct query is 1b.

Then 2-5 are correct.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Create new db in a different drive

Postby Bangwhiz » Sat Dec 20, 2008 5:31 pm

My copy of postgres is 8.3.5. I downloaded the tuning wizard - ran it and it worked fine. Unfortunately I am using XP Home and I ran into some minor issues with unchecking simple file sharing by wiki posted in another thread solved that. Postgres 8.3..5 different from 8.2

Console opens with Programs-PostgreSQL 8.3-psql to 'postgres'. Windows character set different from console - need to change the console font to Lucida but don't know how so I cannot enter table commands, etc. My database is empty and like to get this done before I load up 200K hands to database. Any help greatly appreciated. Tom
Bangwhiz
 
Posts: 40
Joined: Mon May 26, 2008 11:05 am

Simple File Sharing for XP Home

Postby Bangwhiz » Sat Dec 20, 2008 6:04 pm

Here's pointer to thread I posted on unchecking simple file sharing on XP Home vs XP Pro:

viewtopic.php?f=15&t=12136&p=72724#p72724
Bangwhiz
 
Posts: 40
Joined: Mon May 26, 2008 11:05 am

Re: Create new db in a different drive

Postby Bangwhiz » Sat Dec 20, 2008 6:34 pm

Here's a photo of problems I am having with psql console when I try to enter table space commands. Any input on making 2 HHDs possible greatly appreciated.

http://s467.photobucket.com/albums/rr34 ... hot005.jpg

I hope link works - new to photobucket. Tom
Bangwhiz
 
Posts: 40
Joined: Mon May 26, 2008 11:05 am

Re: Create new db in a different drive

Postby Bangwhiz » Sun Dec 21, 2008 3:56 am

Well, I driven myself insane trying to set up PT3 on 2 HDDs. My Postgres version is 8.3.5 The terminal is psql. I followed some instructions to set my terminal window to Lucida Console. Then when I try to do a monkey see monkey do set up the psql terminal tells me that there is a syntax error near "CODE: SELECT ALL" with a small ^ under the C of CODE. Says syntax error at or near the word CREATE with a small ^ under the C of CREATE when I try to create tablespace also.

Man, I could use some help! I know everyone is busy with Christmas, so whenever help comes I will be eternally grateful. Thanks, Tom
Bangwhiz
 
Posts: 40
Joined: Mon May 26, 2008 11:05 am

Re: Create new db in a different drive

Postby WhiteRider » Sun Dec 21, 2008 5:53 am

You should not be entering "CODE: SELECT ALL" - that is just a link to allow you to highlight all the code to copy. The bit you want is the bit inside the box.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Create new db in a different drive

Postby Bangwhiz » Sun Dec 21, 2008 1:33 pm

:oops: No wonder the syntax was wrong! The command didn't exist. I'll try again. Thanks! Tom
Bangwhiz
 
Posts: 40
Joined: Mon May 26, 2008 11:05 am

Re: Create new db in a different drive

Postby hohoho » Mon Feb 02, 2009 8:39 am

Can someone help me do this? I can't setup a new dbase on my D drive.

Setup : Windows XP Home. Postgres 8.3. Drive C : FAT32, Drive D:NTFS. Asus laptop, and c and d are merely paritions on one 80gig HD.

I have done the following :

- created Pg_data folder on drive d: . Set the security etc.
- copied the schema file onto the root of drive d
- ensured my pg_data folder is empty

I go to the postgres console and type :

CREATE TABLESPACE spare_disk LOCATION 'D:\\pg_data';

I get the error message :

WARNING : nonstandard use of \\ in a string literal
LINE 1 : CTREATE TABLESPACE spare_disk LOCATION 'D:\\pgdata';

HINT : Use escape string syntax for backslashes, e.g., E'\\'.
ERROR : could not set junction for "\??\d:\pgdata": incorrect function

Help!
hohoho
 
Posts: 108
Joined: Mon Oct 27, 2008 6:54 am

Re: Create new db in a different drive

Postby kraada » Mon Feb 02, 2009 10:46 am

Try this instead:

CREATE TABLESPACE spare_disk LOCATION 'D:/pg_data';

and see if that works better for you.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

PreviousNext

Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 11 guests

cron
highfalutin