BE VERY CAREFUL - FOLLOW THESE INSTRUCTIONS TO THE LETTER - BACKUP ANYTHING YOU VALUE!!! This is done using the PostgreSQL command TABLESPACE - documentation here:
http://www.postgresql.org/docs/8.2/stat ... paces.htmlLet us go with the original request, and presume we already have postgres up and running perfectly, installed to our C:\ drive. OP does not specify, so I'm just going to assume he has a brand new empty partition, called D:\. Here is where he wishes to create new databases.
These instructions apply to Windows XP PRO - it may vary for XP Home, I have no idea. At a guess I'd assume the File system permissions bit isn't needed / doesn't exist - someone please inform us if so. Same goes for Vista, I have no idea how ACL works on those.
You will need "Simple File Sharing" disabled, so you can set folder-level ACL settings.
You will need to be logged in as Administrator.
Preparation:1. Using Windows Explorer, create a "New Folder" in the root of D:\ - let us call it "pg_data". You can choose what you want, remember it.
2. Right-click on this folder, choose Properties. Select the "Security" tab. Here we see a list of users allowed to access our new folder. We must add the database superuser "postgres" to this list. So click "Add", type in the little box "postgres" (without quotes), then hit the "Chack Names" button. It should fix the name to correct format (for me, it became A64\postgres). If it does similar, good. Hit OK. User "postgres" should now appear in the "groups or user names" list on the "Security" tab. Select it, then tick the box in the panel below to "Allow/Full Control" All the boxes should be ticked. If so, good, Apply/OK, and we are done with this part.
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!
Execution:4. Open a command console to the database. You can probably do this in pgAdmin, but I didn't. Do "Start -> Programs -> PostgreSQL 8.2 -> psql to template1" you should get a console.
BE VERY CAREFUL TO TYPE EVERYTHING EXACTLY AS WRITTEN!
note there are TWO backslashes in the 'D:\\pg_data' location command.
5: type the following commands - [Enter] after each line, any error messages, stop!
- Code: Select all
CREATE TABLESPACE spare_disk LOCATION 'D:\\pg_data';
- Code: Select all
CREATE DATABASE pt3_beta3_newdb TABLESPACE spare_disk;
- Code: Select all
\connect pt3_beta3_newdb
The prompt should change to reflect the new database we have connected the console to - if it doesn't, stop!
- Code: Select all
\cd D:
- Code: Select all
\i schema.postgres.sql
It should run through a load of commands to build the pt3 database structure now. we are done with the console.
- Code: Select all
\q
and it should go away.
Now in to PokerTracker 3! We need to add our newly created database to it's configuration.
6. Select "Database -> Database Management". Hit the "New" button. Check the host settings are correct, and hit the "Browse Databases" link. You should see in the list, the newly created "pt3_beta3_newdb" - select it, then OK. It should have auto-ticked "this database already exists", but if it didn't - tick it. Change the name at the top to something friendlier if you wish. Hit Connect, it should succeed. We are done - Set it as the Default if you wish, close database management, and switch active databases to the new one - and import some hands, make sure all is OK!
FINISHHopefully this is useful to some, there is more fun to be had with tablespaces, but this should do us until something is built in to PT3's database management utilities
dave.