diff options
author | Daniel Golle <daniel@makrotopia.org> | 2020-09-27 19:55:09 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2020-10-05 15:39:05 +0100 |
commit | daa0f22b63c1442ad51122e5ba140c1ae5890267 (patch) | |
tree | f732b1eb5f78482ff0a7a367a6bce2eff9608437 /src/namestore | |
parent | 400f527fbd5cb6d9523374f6f8d1320339c5b71a (diff) | |
download | gnunet-daa0f22b63c1442ad51122e5ba140c1ae5890267.tar.gz gnunet-daa0f22b63c1442ad51122e5ba140c1ae5890267.zip |
postgres: drop use of 'WITH OIDS'
PostgreSQL since version 12 no longer supports 'WITH OIDS':
Previously, a normally-invisible oid column could be specified during
table creation using WITH OIDS; that ability has been removed. Columns
can still be explicitly declared as type oid. Operations on tables that
have columns created using WITH OIDS will need adjustment.
The system catalogs that previously had hidden oid columns now have
ordinary oid columns. Hence, SELECT * will now output those columns,
whereas previously they would be displayed only if selected explicitly.
Drop 'WITH OIDS' as it was stated even on tables for plugins which
didn't make any use of the then exposed 'oid' column.
In the case of datacache and datastore the 'oid' column is used,
so replace the 'WITH OIDS' statement with an explicit 'oid' column
having 'OID' type and a corresponding sequence.
No measures are taken to still work with PostgreSQL before version 12.
Users should update PostgreSQL to version 12 or newer.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/plugin_namestore_postgres.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c index 01dddde9e..04100567c 100644 --- a/src/namestore/plugin_namestore_postgres.c +++ b/src/namestore/plugin_namestore_postgres.c | |||
@@ -73,8 +73,7 @@ database_setup (struct Plugin *plugin) | |||
73 | " record_data BYTEA NOT NULL DEFAULT ''," | 73 | " record_data BYTEA NOT NULL DEFAULT ''," |
74 | " label TEXT NOT NULL DEFAULT ''," | 74 | " label TEXT NOT NULL DEFAULT ''," |
75 | " CONSTRAINT zl UNIQUE (zone_private_key,label)" | 75 | " CONSTRAINT zl UNIQUE (zone_private_key,label)" |
76 | ")" | 76 | ")"); |
77 | "WITH OIDS"); | ||
78 | struct GNUNET_PQ_ExecuteStatement es_default = | 77 | struct GNUNET_PQ_ExecuteStatement es_default = |
79 | GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS ns098records (" | 78 | GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS ns098records (" |
80 | " seq BIGSERIAL PRIMARY KEY," | 79 | " seq BIGSERIAL PRIMARY KEY," |
@@ -85,8 +84,7 @@ database_setup (struct Plugin *plugin) | |||
85 | " record_data BYTEA NOT NULL DEFAULT ''," | 84 | " record_data BYTEA NOT NULL DEFAULT ''," |
86 | " label TEXT NOT NULL DEFAULT ''," | 85 | " label TEXT NOT NULL DEFAULT ''," |
87 | " CONSTRAINT zl UNIQUE (zone_private_key,label)" | 86 | " CONSTRAINT zl UNIQUE (zone_private_key,label)" |
88 | ")" | 87 | ")"); |
89 | "WITH OIDS"); | ||
90 | const struct GNUNET_PQ_ExecuteStatement *cr; | 88 | const struct GNUNET_PQ_ExecuteStatement *cr; |
91 | struct GNUNET_PQ_ExecuteStatement sc = GNUNET_PQ_EXECUTE_STATEMENT_END; | 89 | struct GNUNET_PQ_ExecuteStatement sc = GNUNET_PQ_EXECUTE_STATEMENT_END; |
92 | 90 | ||