#
#  Configuration for the SQL module, when using Postgresql.
#
#  The database schema is available at:
#
#	doc/examples/postgresql.sql
#
#  Updated for using AttributeGroup/AttributeNumber in *reply tables.


# server & password must already be defined
	driver = "rlm_sql_postgresql"
	login = "postgres"
	radius_db = "postgres"

	acct_table1 = "radius.radacct"
	acct_table2 = "radius.radacct"

	# Allow for storing data after authentication
	postauth_table = "radius.radpostauth"

	authcheck_table = "radius.radcheck"
	authreply_table = "radius.radreply"

	groupcheck_table = "radius.radgroupcheck"
	groupreply_table = "radius.radgroupreply"

	# Table to keep group info
	radusergroup_table = "radius.radusergroup"

	# Where to store a request
	authorize_radrequest_table = "radius.radrequest"

	# Remove stale session if checkrad does not see a double login
	deletestalesessions = yes

	# Print all SQL statements when in debug mode (-x)
	sqltrace = no
#	sqltracefile = ${logdir}/sqltrace.sql

	# number of sql connections to make to server
	num_sql_socks = 5

	sql_user_name = "%{Stripped-User-Name:-%{User-Name:-DEFAULT}}"

	group_membership_query = "SELECT GroupName FROM ${radusergroup_table} WHERE UserName='%{SQL-User-Name}'"
	postauth_query = "SELECT radius.post_authentication('%{SQL-User-Name}', '%{reply:Packet-Type}', '%{Acct-Session-Id}', '%{Colubris-Access-Controlled}',  %{Colubris-VSC-Index}, %{Colubris-Active-User-Sessions}, '%{reply:Colubris-Auth-Method}','%{EAP-Type}', '%{request:Freeradius-Proxied-To}' )"