summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-01-07 16:29:25 +0100
committerAndrey Andreev <narf@devilix.net>2014-01-07 16:29:25 +0100
commit69e1b4f054521bc055af9e2b377a3a578fc6cadc (patch)
tree6baeab9e1bbe399364d21ca374d901e27a6fa3e8
parente0da15316d6a00334cd3c56421ad361453bd4281 (diff)
[ci skip] Add a PostgreSQL CREATE TABLE sample to the Session docs
From PR #2758
-rw-r--r--user_guide_src/source/libraries/sessions.rst19
1 files changed, 16 insertions, 3 deletions
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;