diff options
Diffstat (limited to 'src/datastore')
-rw-r--r-- | src/datastore/datastore_api.c | 8 | ||||
-rw-r--r-- | src/datastore/plugin_datastore_postgres.c | 14 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index 4537f6efe..bd7a612ed 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c | |||
@@ -994,8 +994,8 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, | |||
994 | } | 994 | } |
995 | 995 | ||
996 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 996 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
997 | "Asked to put %u bytes of data under key `%s' for %s\n", | 997 | "Asked to put %lu bytes of data under key `%s' for %s\n", |
998 | size, | 998 | (unsigned long) size, |
999 | GNUNET_h2s (key), | 999 | GNUNET_h2s (key), |
1000 | GNUNET_STRINGS_relative_time_to_string ( | 1000 | GNUNET_STRINGS_relative_time_to_string ( |
1001 | GNUNET_TIME_absolute_get_remaining (expiration), | 1001 | GNUNET_TIME_absolute_get_remaining (expiration), |
@@ -1205,8 +1205,8 @@ GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, | |||
1205 | if (NULL == cont) | 1205 | if (NULL == cont) |
1206 | cont = &drop_status_cont; | 1206 | cont = &drop_status_cont; |
1207 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1207 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1208 | "Asked to remove %u bytes under key `%s'\n", | 1208 | "Asked to remove %lu bytes under key `%s'\n", |
1209 | size, | 1209 | (unsigned long) size, |
1210 | GNUNET_h2s (key)); | 1210 | GNUNET_h2s (key)); |
1211 | env = GNUNET_MQ_msg_extra (dm, | 1211 | env = GNUNET_MQ_msg_extra (dm, |
1212 | size, | 1212 | size, |
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 ( |