Postgres SQL Alarm on duplicated record

Santiago Balaguer García santiagoawa at hotmail.com
Tue Mar 18 08:52:02 CET 2008


HI,
 
  I supposed you have in radiusd.conf file this code:
 # Create a unique accounting session Id.  Many NASes re-use or        # repeat values for Acct-Session-Id, causing no end of        # confusion.        #        #  This module will add a (probably) unique session id        #  to an accounting packet based on the attributes listed        #  below found in the packet.  See doc/rlm_acct_unique for        #  more information.        #        acct_unique {                key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port"        }
 
However, it is true that there is sometimes a duplicate key. This is because of in the original configuration of database schema, the primary key of radacct table is only radacctid. I modified the primary keys by (radacctid, acctuniqueid)
 
CREATE TABLE radacct(  radacctid bigserial NOT NULL,  acctsessionid varchar(32) NOT NULL,  acctuniqueid varchar(32) NOT NULL,  username varchar(127),  realm varchar(30),  nasipaddress inet NOT NULL,  nasportid varchar(32),  nasporttype varchar(32),  acctstarttime timestamptz,  acctstoptime timestamptz,  acctsessiontime int8,  acctauthentic varchar(32),  connectinfo_start varchar(32),  connectinfo_stop varchar(32),  acctinputoctets int8,  acctoutputoctets int8,  calledstationid varchar(50),  callingstationid varchar(50),  acctterminatecause varchar(32),  servicetype varchar(32),  framedprotocol varchar(32),  framedipaddress inet,  acctstartdelay int8,  acctstopdelay int8,  nasidentifier varchar(40),  clientipaddress inet,  CONSTRAINT radacct_pkey PRIMARY KEY (acctuniqueid, radacctid)) 
> Date: Fri, 14 Mar 2008 03:38:52 -0700> From: man_gust at yahoo.com> To: freeradius-users at lists.freeradius.org> Subject: Postgres SQL Alarm on duplicated record> > > Hello.> Some times my NAS resend START record to RADIUS. > > The And I get the alarm messages like that , because the differences in this> start record is only in Start time and radacct_acctuniqueid_key are always> equal for such sessions.> :> > Wed Mar 12 18:05:10 2008 : Error: rlm_sql (sql): Couldn't insert SQL> accounting START record - ERROR: duplicate key violates unique constraint> "radacct_acctuniqueid_key" > > But, in any case all such start records are put to database.> > How I cat stop put such duplicate records?> > -- > View this message in context: http://www.nabble.com/Postgres-SQL-Alarm-on-duplicated-record-tp16046727p16046727.html> Sent from the FreeRadius - User mailing list archive at Nabble.com.> > -> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
_________________________________________________________________
MSN Video. 
http://video.msn.com/?mkt=es-es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20080318/f7b7f2aa/attachment.html>


More information about the Freeradius-Users mailing list