Moved unused and unneeded stored procedure to a separate file
[freeradius.git] / doc / examples / postgresql.sql
index 9980372..bd897cd 100644 (file)
@@ -18,7 +18,6 @@ CREATE TABLE radacct (
        AcctSessionId           VARCHAR(32) NOT NULL,
        AcctUniqueId            VARCHAR(32) NOT NULL,
        UserName                VARCHAR(253),
-       GroupName               VARCHAR(253),
        Realm                   VARCHAR(64),
        NASIPAddress            INET NOT NULL,
        NASPortId               VARCHAR(15),
@@ -38,7 +37,8 @@ CREATE TABLE radacct (
        FramedProtocol          VARCHAR(32),
        FramedIPAddress         INET,
        AcctStartDelay          BIGINT,
-       AcctStopDelay           BIGINT
+       AcctStopDelay           BIGINT,
+       XAscendSessionSvrKey    VARCHAR(10)
 );
 -- This index may be usefull..
 -- CREATE UNIQUE INDEX radacct_whoson on radacct (AcctStartTime, nasipaddress);
@@ -192,6 +192,22 @@ CREATE TABLE radpostauth (
 ) ;
 
 --
+-- Table structure for table 'radippool'
+--
+
+CREATE TABLE radippool (
+       id                      BIGSERIAL PRIMARY KEY,
+       pool_name               text NOT NULL,
+       FramedIPAddress         INET,
+       NASIPAddress            text NOT NULL,
+       CalledStationId         VARCHAR(64),
+       CallingStationId        text NOT NULL DEFAULT ''::text,
+       expiry_time             TIMESTAMP(0) without time zone NOT NULL,
+       username                text DEFAULT ''::text,
+       pool_key                VARCHAR(30) NOT NULL
+);
+
+--
 -- Table structure for table 'dictionary'
 -- This is not currently used by FreeRADIUS
 --
@@ -204,28 +220,3 @@ CREATE TABLE radpostauth (
 --     Vendor          VARCHAR(32)
 -- );
 
-/*
- * Note: (pnixon: 2003-12-10) The following function should not be required
- * if you use the PG specific queries in raddb/postgresql.conf
- *
- * Common utility function for date calculations. This is used in our
- * alternative account stop query to calculate the start of a session.
- *
- * This function is Copyright 2001 by Mark Steele (msteele@inet-interactif.com)
- *
- * Please note that this requires the plpgsql to be available in your
- * radius database. If it is not available you can register it with
- * postgres by running this command:
- *
- *   createlang plpgsql <databasename>
- */
-CREATE FUNCTION DATE_SUB(date,int4,text) RETURNS DATE AS '
-DECLARE
-        var1 date;
-        var2 text;
-BEGIN
-        var2 = $2 || '' '' || $3;
-        SELECT INTO var1
-                to_date($1 - var2::interval, ''YYYY-MM-DD'');
-RETURN var1;
-END;' LANGUAGE 'plpgsql';