logger table - Mailing list pgsql-general

From Philipp Kraus
Subject logger table
Date
Msg-id 38526465-08D1-40A0-B2AB-A4DAA3ACB858@flashpixx.de
Whole thread Raw
Responses Re: logger table  (Alejandro Carrillo <fasterzip@yahoo.es>)
Re: logger table  (John R Pierce <pierce@hogranch.com>)
Re: logger table  (Jason Dusek <jason.dusek@gmail.com>)
List pgsql-general
Hello,

I need some ideas for creating a PG based logger. I have got a job, which can run more than one time. So the PK is at
themoment jobid & cycle number. 
The inserts in this table are in parallel with the same username from different host (clustering). The user calls in
theexecutable "myprint" and the message 
will insert into this table, but at the moment I don't know a good structure of the table. Each print call can be
differentlength, so I think a text field is a good 
choice, but I don't know how can I create a good PK value. IMHO a sequence can be create problems that I'm logged in
withthe same user on multiple 
hosts, a hash key value like SHA1 based on the content are not a good choice, because content is not unique, so I can
getkey collisions.  
I would like to create on each "print" call a own record in the table, but how can I create a good key value and get no
problemsin parallel access. 
I think there can be more than 1000 inserts each second.

Does anybody can post a good idea?

Thanks

Phil

pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: downgrading a database
Next
From: Alejandro Carrillo
Date:
Subject: Re: logger table