Unable to authenticate freeradius using PostgreSQL

Kevin Bonner keb at pa.net
Wed Nov 29 17:16:05 CET 2006

On Wednesday 29 November 2006 05:52, Ross McOwat wrote:
> radius_xlat:  'SELECT id, UserName, Attribute, Value, Op
> #?authorize_check_query = '
> rlm_sql (sql): Reserving sql socket id: 4
> rlm_sql_postgresql: query: SELECT id, UserName, Attribute, Value, Op
> #?authorize_check_query =
> rlm_sql_postgresql: Status: PGRES_FATAL_ERROR

radius_xlat now shows the query, but "SELECT id, UserName, Attribute, Value, 
Op" is not a valid SQL query.  The "authorize_check_query" being listed in 
the radius_xlat line means that you haven't properly quoted the SQL query in 
the config file.  Look at the default postgresql.conf to see what you're 
missing... paying close attention to quotation marks.

> I have changed the 'value' and 'op' columns around, as the
> authentication sql query within postgresql.conf appears to try and
> retrieve 'value' before 'op'.  Using the supplied database schema, the
> op column appears BEFORE value.  Not sure if this is significant or not?
> Or possibly the actual data format I've entered is incorrect?  I suspect
> (hope) it's something as simple as that.

It doesn't matter how the table columns are arranged, as long as your query 
asks for them in the correct order.

Kevin Bonner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20061129/e0cfd706/attachment.pgp>

More information about the Freeradius-Users mailing list