list for not removing custom tables on db upgrade

Let us know what features not currently in the PT4 should be added.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

list for not removing custom tables on db upgrade

Postby greedysoul » Fri Jul 04, 2014 10:46 am

Please if it's possible allow a textfile list of (custom) tables and views not to be removed when doing an upgrade. I'm stuck at version 4.10.9 and upgrading to version 4.11.x attempts to remove all my custom tables/views which I have a few dozen and would rather not touch when upgrading. :cry:
greedysoul
 
Posts: 42
Joined: Sat Feb 23, 2008 12:41 pm

Re: list for not removing custom tables on db upgrade

Postby WhiteRider » Fri Jul 04, 2014 11:14 am

We do not support modifying PokerTracker databases so I'm afraid you will need to maintain any changes you make. Having PT4 avoid any changes could make the update process less efficient (take longer), and would certainly involve some development work which would only help a tiny proportion of our users.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: list for not removing custom tables on db upgrade

Postby _dave_ » Sun Jul 06, 2014 10:32 pm

OP, look in to the command line program pg_dump (part of default postgresql installation). for example:

Code: Select all
pg_dump -t 'custom_table1' -t 'custom_table2'  pt4_1213213_!23213 > db.sql


would create an SQL file you could reload to restore your custom table 1 & 2 after the update has completed.

http://www.postgresql.org/docs/9.1/stat ... gdump.html

Views should just be copy/pastable from PGAdmin, although dump's -t option will work on a view also. If you prefix all your custom stuff with a certain sequence, you can use wildcards in -t also - e.g.
Code: Select all
-t 'custom_table*'
would dump them both from the above example.

I might try the "it will certainly involve some development effort" excuse next time a customer requests me develop them some software that doesn't have the side effect of delete their work! lol
_dave_
 
Posts: 1147
Joined: Sun Dec 09, 2007 6:19 pm

Re: list for not removing custom tables on db upgrade

Postby _dave_ » Sun Jul 06, 2014 10:39 pm

in fact, here I've done most of the work for you!

add to your update code, before it executes: ( - capital T excludes a table)

Code: Select all
pg_dump -T 'tourney_hand_player_statistics' -T 'tourney_hand_summary' ...

complete the list with the names of all PT4 tables, which surely isn't hard for a PT4 developer to find, and there you go - it will backup any alien tables. after update is done, restore them.

Might not work, didn't test of course - would be too much effort :p But it should I think!
_dave_
 
Posts: 1147
Joined: Sun Dec 09, 2007 6:19 pm


Return to PT4 Feature Requests

Who is online

Users browsing this forum: No registered users and 3 guests