On Tue, Aug 10, 2004 at 04:18:08PM +0800, ac wrote:
>     I use postgresql to record all the radacct-pkts from the freeradius-0.9.3.
>     But sometimes the record with the same acctuniqueid, acctsessionid 
> appears twice or much more times.
>     I don't know why it happened and how to avoid it.

Check if Acct-Delay-Time differs in requests. If it does, looks like you
have one of the following problems:

1. Network problems, so Accounting-Ack sometimes does not reach NAS, so
it re-sends request.
2. Slow database, so it takes too long time to accomplish the request
and the NAS gets timed out, again, re-sending the request. In this case
you can try to configure your NAS for greater timeout.

Some people would suggest using UNIQUE constraint on acctUniqueId column,
which also seems reasonable.

>    By the way, is there any sql statment which can help me to delete or skip 
> the duplicate records with the same  acctuniqueid ?

If you have a serial id column in default schema try using

SELECT * FROM radacct WHERE EXISTS (
        SELECT  1 FROM radacct r2
        WHERE   r2.id < radacct.id -- note the "<"
        AND     r2.acctUniqueId = radacct.acctUniqueId
);

Then, if you sure that's it, replace SELECT with DELETE.
If you want leave the first of dups, use "<", if you want the last - ">".

-- 
Fduch M. Pravking

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to