<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
HI,<BR>
<BR>
I supposed you have in radiusd.conf file this code:<BR>
# Create a unique accounting session Id. Many NASes re-use or<BR> # repeat values for Acct-Session-Id, causing no end of<BR> # confusion.<BR> #<BR> # This module will add a (probably) unique session id<BR> # to an accounting packet based on the attributes listed<BR> # below found in the packet. See doc/rlm_acct_unique for<BR> # more information.<BR> #<BR> acct_unique {<BR> key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port"<BR> }<BR>
<BR>
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)<BR>
<BR>
CREATE TABLE radacct<BR>(<BR> radacctid bigserial NOT NULL,<BR> acctsessionid varchar(32) NOT NULL,<BR> acctuniqueid varchar(32) NOT NULL,<BR> username varchar(127),<BR> realm varchar(30),<BR> nasipaddress inet NOT NULL,<BR> nasportid varchar(32),<BR> nasporttype varchar(32),<BR> acctstarttime timestamptz,<BR> acctstoptime timestamptz,<BR> acctsessiontime int8,<BR> acctauthentic varchar(32),<BR> connectinfo_start varchar(32),<BR> connectinfo_stop varchar(32),<BR> acctinputoctets int8,<BR> acctoutputoctets int8,<BR> calledstationid varchar(50),<BR> callingstationid varchar(50),<BR> acctterminatecause varchar(32),<BR> servicetype varchar(32),<BR> framedprotocol varchar(32),<BR> framedipaddress inet,<BR> acctstartdelay int8,<BR> acctstopdelay int8,<BR> nasidentifier varchar(40),<BR> clientipaddress inet,<BR> CONSTRAINT radacct_pkey PRIMARY KEY (acctuniqueid, radacctid)<BR>) <BR><BR>
<BR>> Date: Fri, 14 Mar 2008 03:38:52 -0700<BR>> From: man_gust@yahoo.com<BR>> To: freeradius-users@lists.freeradius.org<BR>> Subject: Postgres SQL Alarm on duplicated record<BR>> <BR>> <BR>> Hello.<BR>> Some times my NAS resend START record to RADIUS. <BR>> <BR>> The And I get the alarm messages like that , because the differences in this<BR>> start record is only in Start time and radacct_acctuniqueid_key are always<BR>> equal for such sessions.<BR>> :<BR>> <BR>> Wed Mar 12 18:05:10 2008 : Error: rlm_sql (sql): Couldn't insert SQL<BR>> accounting START record - ERROR: duplicate key violates unique constraint<BR>> "radacct_acctuniqueid_key" <BR>> <BR>> But, in any case all such start records are put to database.<BR>> <BR>> How I cat stop put such duplicate records?<BR>> <BR>> -- <BR>> View this message in context: http://www.nabble.com/Postgres-SQL-Alarm-on-duplicated-record-tp16046727p16046727.html<BR>> Sent from the FreeRadius - User mailing list archive at Nabble.com.<BR>> <BR>> -<BR>> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html<BR><BR><br /><hr />Todo ruedas: información práctica y todo el glamour del mundo del motor. <a href='http://estilo.es.msn.com/' target='_new'>MSN Estilo y Tendencias</a></body>
</html>