(RADIATOR) time format is not written well in PostgreSQL

Hugh Irvine hugh at open.com.au
Thu Dec 18 17:58:15 CST 2003


Hello Deden -

I am not familiar with PostgreSQL, but it looks like the "to_date"  
fuction is not correctly interpreting the parameters that are being  
passed to it.

You should check the "to_date" documentation.

My guess is that you should remove the colons ":" from between %H:%M:%S  
as shown below.

        AcctColumnDef   time_stamp,Timestamp,formatted-date,to_date \
        ('%e %m %Y %H %M %S', 'DD MM YYYY HH:MI:SS')

See the PostgreSQL manual:

	http://www.postgresql.org/docs/7.4/static/functions-formatting.html

BTW - you may also be able to just use the new %A or %F special  
characters directly.

See section 6.2 in the Radiator 3.7.1 reference manual ("doc/ref.html").

regards

Hugh


On 18/12/2003, at 8:49 PM, deden purnamahadi wrote:

> The Configuration :
>
> ---
>
> Foreground
> LogStdout
> LogDir          /usr/local/src/Radiator-3.7/log
> DbDir           .
> #DbDir          /usr/local/srd/Radiator-3.7/raddb
> Trace           4
>
> # You will probably want to add other Clients to suit your site.
> <Client x.x.x.x)>
> #<Client DEFAULT>
>        Secret  adaajah
>        DupInterval 0
> </Client>
>
> <Realm DEFAULT>
>        AuthByPolicy    ContinueAlways
>        RewriteUsername s/^([^@]+).*/$1/
> #       AcctLogFileName %L/details
>
>
> <AuthBy SQL>
> #do the accounting but not authentication
>        AuthSelect
>        DBSource        dbi:Pg:dbname=radiator;host=x.x.x.x
>        DBUsername      post
>        DBAuth          post
>        AccountingTable accounting
>        AcctColumnDef   username,User-Name
>        AcctColumnDef   time_stamp,Timestamp,formatted-date,to_date \
>        ('%e %m %Y %H:%M:%S', 'DD MM YYYY HH:MI:SS')
>        AcctColumnDef   acctstatustype,Acct-Status-Type
>        AcctColumnDef   acctdelaytime,Acct-Delay-Time,integer
>        AcctColumnDef   acctinputoctets,Acct-Input-Octets,integer
>        AcctColumnDef   acctoutputoctets,Acct-Output-Octets,integer
>        AcctColumnDef   acctsessionid,Acct-Session-Id
>        AcctColumnDef   acctsessiontime,Acct-Session-Time,integer
>        AcctColumnDef   acctterminatecause,Acct-Terminate-Cause
>        AcctColumnDef   nasidentifier,NAS-Identifier
>        AcctColumnDef   nasport,NAS-Port,integer
>        AcctColumnDef   frameipaddress,Framed-IP-Address
>        AcctColumnDef   userrequest,User-Request
>        AcctFailedLogFileName %D/missedaccounting
> ...
>
>
> Message when a call received :
>
> Thu Dec 18 16:44:16 2003: DEBUG: Handling request with Handler  
> 'Realm=DEFAULT'
> Thu Dec 18 16:44:16 2003: DEBUG: Rewrote user name to user_a
> Thu Dec 18 16:44:16 2003: DEBUG:  Adding session for dedenph,  
> 202.80.208.4, 10
> Thu Dec 18 16:44:16 2003: DEBUG: Handling with Radius::AuthSQL
> Thu Dec 18 16:44:16 2003: DEBUG: Handling accounting with  
> Radius::AuthSQL
> Thu Dec 18 16:44:16 2003: DEBUG: do query is: 'insert into accounting  
> (acctdelaytime,acctsessionid,acctstatustype,frameipaddress,nasport,time 
> _stamp,username) values  
> (0,'030000B7','Start','202.80.208.37',10,to_date ('18 12 2003  
> 16:44:16', 'DD MM YYYY HH:MI:SS'),'user_a')':
>
> Problem :
> Content in database for time stamp showing that the time is :  '18 12  
> 2003 00:00:00'
> So, it's not really put the real time.
>
>
> What could be wrong ???
>
> TIA
>
>
>
>
>
>
> Warmest regards
>
>
> ddn
>
> _________________________________________________________________
> Tired of spam? Get advanced junk mail protection with MSN 8.  
> http://join.msn.com/?page=features/junkmail
>
> ===
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>
>

NB: have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list