From: Jakub Jirutka Date: Thu, 20 Feb 2020 00:12:18 +0000 (+0100) Subject: fix postgresql schema for cui X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=720f2dd69579caa7e1ddfde83b2bde889eb3e3b8;p=thirdparty%2Ffreeradius-server.git fix postgresql schema for cui I'm getting the following error with the current schema: rlm_sql_postgresql: 22001: STRING DATA RIGHT TRUNCATION Moreover, in PostgreSQL the text type is highly preferred above varchar. Schema for radacct already uses it, so it seems that schema for cui is just outdated. I also remove quotes around `now()`, it was probably some archaism. --- diff --git a/raddb/mods-config/sql/cui/postgresql/schema.sql b/raddb/mods-config/sql/cui/postgresql/schema.sql index 6d54824448d..c16c54070ee 100644 --- a/raddb/mods-config/sql/cui/postgresql/schema.sql +++ b/raddb/mods-config/sql/cui/postgresql/schema.sql @@ -1,9 +1,9 @@ CREATE TABLE cui ( clientipaddress inet NOT NULL DEFAULT '0.0.0.0', - callingstationid varchar(50) NOT NULL DEFAULT '', - username varchar(64) NOT NULL DEFAULT '', - cui varchar(128) NOT NULL DEFAULT '', - creationdate timestamp with time zone NOT NULL DEFAULT 'now()', + callingstationid text NOT NULL DEFAULT '', + username text NOT NULL DEFAULT '', + cui text NOT NULL DEFAULT '', + creationdate timestamp with time zone NOT NULL DEFAULT now(), lastaccounting timestamp with time zone NOT NULL DEFAULT '-infinity'::timestamp, PRIMARY KEY (username, clientipaddress, callingstationid) );