SQL 8.2.7 - complete purged Database has still 3GB

Forum with tips, support, etc, on using the PostgreSQL database with Poker Tracker. Please post any PostgreSQL questions here.

Re: SQL 8.2.7 - complete purged Database has still 3GB

Postby balllala » Sun Sep 28, 2008 5:11 am

I did as you told me, but now the whole table is gone.
Instead of 22 (like all other database have), it only has 21 with the table "hand_histories" missing.
Yet i haven´t tried to import knew hands into this database. You think PT2 would make a new folder "hand_histories".

edit: after a restart and the second time full vakuum the database shrink to about 700MB what should be acceptable, but i´m still concerned about the missing table in that database
balllala
 
Posts: 10
Joined: Mon May 12, 2008 5:47 am

Re: SQL 8.2.7 - complete purged Database has still 3GB

Postby ptrack pat » Sun Sep 28, 2008 9:48 am

Using the SQL statement I gave you would NOT have deleted the table, if it's gone then you had to have manually deleted it some other way. All that SQL statement did was delete the data from the table.

So now you need to recreate the table. Open the Query Tool window and copy paste the following...

CREATE TABLE hand_histories
(
game_number integer,
site_id smallint,
hand_history text,
import_date timestamp with time zone,
CONSTRAINT hand_histories_idx_01 UNIQUE (game_number, site_id, import_date)
)
WITHOUT OIDS;
ALTER TABLE hand_histories OWNER TO postgres;

ALTER TABLE hand_histories
ADD CONSTRAINT hand_histories_idx_01 UNIQUE(game_number, site_id, import_date);

Then hit F5 to execute.
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: SQL 8.2.7 - complete purged Database has still 3GB

Postby balllala » Sun Sep 28, 2008 1:33 pm

But i really didn´t do anything else than you told me. I´m sure not to delete it manually, because after i did the query you told me it was gone.

With your knew query i got the following message

"
NOTICE: CREATE TABLE / UNIQUE will create implicit index "hand_histories_idx_01" for table "hand_histories"
NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "hand_histories_idx_01" for table "hand_histories"

ERROR: relation "hand_histories_idx_01" already exists
SQL state: 42P07
"

Anyway it won´t bother me if this Database will stay corrupted, because i can create a knew one, as this one already was empty.
But i want to find a way to keep the size of database smaller than they get at the moment. Something seems not to get deleted in the normal way so my Databases grow and grow with time, and unfortunately i´m importing a lot of hands in a month.
balllala
 
Posts: 10
Joined: Mon May 12, 2008 5:47 am

Re: SQL 8.2.7 - complete purged Database has still 3GB

Postby ptrack pat » Sun Sep 28, 2008 2:41 pm

Nothing I told you to do in the SQL statements would delete the table, the only way to delete a table in PostgreSQL is to use a "DROP" statement or to manually delete it in pgAdmin by clicking on it and selecting to drop it from the menu, it wouldn't just disappear otherwise.

ERROR: relation "hand_histories_idx_01" already exists
SQL state: 42P07


This means the table is not missing so you didn't delete it. I have no idea why you aren't seeing it but it's there if you get this message, either that or you are trying to add it to the wrong database.

Can't you just delete this entire database completely and then if you need to create a new one just do that when you need it?
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: SQL 8.2.7 - complete purged Database has still 3GB

Postby balllala » Sun Sep 28, 2008 5:20 pm

Thanks for your time and support.
Doing this right would have been helpful for my other Databases, but i will find another solution to keep the database small.
balllala
 
Posts: 10
Joined: Mon May 12, 2008 5:47 am

Previous

Return to PostgreSQL Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron
highfalutin