From 69e1b4f054521bc055af9e2b377a3a578fc6cadc Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 7 Jan 2014 17:29:25 +0200 Subject: [ci skip] Add a PostgreSQL CREATE TABLE sample to the Session docs From PR #2758 --- user_guide_src/source/libraries/sessions.rst | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index 4ce355606..c76bccb8c 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -400,11 +400,24 @@ session class:: KEY `last_activity_idx` (`last_activity`) ); +Or if you're using PostgreSQL:: + + CREATE TABLE ci_sessions ( + session_id varchar(40) DEFAULT '0' NOT NULL, + ip_address varchar(45) DEFAULT '0' NOT NULL, + user_agent varchar(120) NOT NULL, + last_activity bigint DEFAULT 0 NOT NULL, + user_data text NOT NULL, + PRIMARY KEY (session_id) + ); + + CREATE INDEX last_activity_idx ON ci_sessions(last_activity); + .. note:: By default the table is called ci_sessions, but you can name it anything you want as long as you update the - application/config/config.php file so that it contains the name you have - chosen. Once you have created your database table you can enable the - database option in your config.php file as follows:: + *application/config/config.php* file so that it contains the name + you have chosen. Once you have created your database table you + can enable the database option in your config.php file as follows:: $config['sess_use_database'] = TRUE; -- cgit v1.2.3-24-g4f1b