aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/plugin_datastore_postgres.c')
-rw-r--r--src/datastore/plugin_datastore_postgres.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index 88ceb1b0a..6a5d45832 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -72,8 +72,10 @@ init_connection (struct Plugin *plugin)
72 * we only test equality on it and can cast it to/from uint32_t. For repl, prio, and anonLevel 72 * we only test equality on it and can cast it to/from uint32_t. For repl, prio, and anonLevel
73 * we do math or inequality tests, so we can't handle the entire range of uint32_t. 73 * we do math or inequality tests, so we can't handle the entire range of uint32_t.
74 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC. 74 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC.
75 * PostgreSQL also recommends against using WITH OIDS. 75 */
76 */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS gn090 (" 76 GNUNET_PQ_make_try_execute (
77 "CREATE SEQUENCE IF NOT EXISTS gn090_oid_seq"),
78 GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS gn090 ("
77 " repl INTEGER NOT NULL DEFAULT 0," 79 " repl INTEGER NOT NULL DEFAULT 0,"
78 " type INTEGER NOT NULL DEFAULT 0," 80 " type INTEGER NOT NULL DEFAULT 0,"
79 " prio INTEGER NOT NULL DEFAULT 0," 81 " prio INTEGER NOT NULL DEFAULT 0,"
@@ -82,8 +84,12 @@ init_connection (struct Plugin *plugin)
82 " rvalue BIGINT NOT NULL DEFAULT 0," 84 " rvalue BIGINT NOT NULL DEFAULT 0,"
83 " hash BYTEA NOT NULL DEFAULT ''," 85 " hash BYTEA NOT NULL DEFAULT '',"
84 " vhash BYTEA NOT NULL DEFAULT ''," 86 " vhash BYTEA NOT NULL DEFAULT '',"
85 " value BYTEA NOT NULL DEFAULT '')" 87 " value BYTEA NOT NULL DEFAULT '',"
86 "WITH OIDS"), 88 " oid OID NOT NULL DEFAULT nextval('gn090_oid_seq'))"),
89 GNUNET_PQ_make_try_execute (
90 "ALTER SEQUENCE gn090_oid_seq OWNED BY gn090.oid"),
91 GNUNET_PQ_make_try_execute (
92 "CREATE INDEX IF NOT EXISTS oid_hash ON gn090 (oid)"),
87 GNUNET_PQ_make_try_execute ( 93 GNUNET_PQ_make_try_execute (
88 "CREATE INDEX IF NOT EXISTS idx_hash ON gn090 (hash)"), 94 "CREATE INDEX IF NOT EXISTS idx_hash ON gn090 (hash)"),
89 GNUNET_PQ_make_try_execute ( 95 GNUNET_PQ_make_try_execute (