Creating notes of players - What is modified in the database

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

Creating notes of players - What is modified in the database

Postby Eric Poker » Fri Nov 07, 2008 6:16 am

Hello
I have created a script that search into a database to retreive the stats of a players (for sng) like roi,itm,number of tourneys played, etc.
I have more then 30 000 players

How can I created a command (using psql to postgres) to add a note to a player ?

If I know the proper format, I will created a script with ahk to "modify" what I have to modify for each players

If you don't know how to do this, I will try by myself but I have to know what is modified when a note is added to a player (to flg_note and other things)

Thank you
Eric Poker
 
Posts: 104
Joined: Sat Mar 15, 2008 3:47 pm

Re: Creating notes of players - What is modified in the database

Postby kraada » Fri Nov 07, 2008 10:31 am

I'm not sure exactly how to build the command in the most efficient fashion in PostgreSQL but, when a player has a note set on them the following things happen:

The entry on the player table for that player has flg_note set to true. A new note with the next sequential id_note entry is generated in the notes table, with the appropriate enum_type (create one player note and select * from notes; and it should be obvious what the enum type is), and id_x for a player note is set equal to the id_player from the player table. date_note is a timestamp the note was entered. Then notes is set equal to whatever text you want to be in the note.

Good luck.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Creating notes of players - What is modified in the database

Postby Eric Poker » Fri Nov 07, 2008 8:42 pm

Thank you

What happen if I turn flg_note to true and I don't create the note ?
Eric Poker
 
Posts: 104
Joined: Sat Mar 15, 2008 3:47 pm

Re: Creating notes of players - What is modified in the database

Postby kraada » Sat Nov 08, 2008 9:47 am

I'm honestly not 100% sure, but it's entirely possible it would break something.

If you're feeling adventurous, try it, and see what happens; you can always set it back if it breaks PT3. I'd recommend doing it on just one player though as a test if you're going to go that route.

Let me know how it goes in the end? I'd appreciate it.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Creating notes of players - What is modified in the database

Postby Eric Poker » Sat Nov 08, 2008 10:24 pm

kraada wrote:I'm honestly not 100% sure, but it's entirely possible it would break something.

If you're feeling adventurous, try it, and see what happens; you can always set it back if it breaks PT3. I'd recommend doing it on just one player though as a test if you're going to go that route.

Let me know how it goes in the end? I'd appreciate it.



Nothing wrong happen
If I create a note in pt3 and delete it, flg_note became false

I think the best option for me will be to create a Stats with id_player and then run a report with Player names / id# then note the last id I have tracked.

If I purge hands from a player (using beta 20), his entry in the player table is delete or not ? If the entry is delete, the id# is reasigned to a new player ?


thanks
Eric Poker
 
Posts: 104
Joined: Sat Mar 15, 2008 3:47 pm

Re: Creating notes of players - What is modified in the database

Postby APerfect10 » Sun Nov 09, 2008 5:26 pm

No the identifiers are not re-used.

Best regards,

Derek
APerfect10
Site Admin
 
Posts: 4465
Joined: Sat Dec 08, 2007 6:03 pm


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 84 guests

cron