LP 1730726: Add Release Notes for PostgreSQL 10 Support.
[Evergreen.git] / docs / RELEASE_NOTES_NEXT / Architecture / postgresql10.adoc
1 Database Support for PostgreSQL 10
2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 The Evergreen database can now be built with PostgreSQL version 10.
4
5 This update has implications for developers who write PgTap tests.  In
6 versions of PostgreSQL prior to 10, one could write `\set ECHO` to
7 disable the echoing of commands as they were run.  In PostgreSQL
8 version 10, using `\set` without a value is an error.  One should now
9 write `\set ECHO none` in order to disable the echoing of commands.
10 This latter form works in all versions of PostgreSQL currently
11 supported by Evergreen.
12
13 Database Upgrade
14 ++++++++++++++++
15 If you upgrade your database from a PostgreSQL version of 9.5, or
16 lower, to PostgreSQL versions 9.6 or 10, you will need to recreate 3
17 indexes in additon to the normal database upgrade steps.  The index
18 recreation is necessary because of changes to the PostgreSQL
19 `unaccent` extension module.
20
21 The following snippet of SQL code will do the necessary steps:
22
23 [source,sql]
24 ------------------------------------------------------------------------
25 DROP INDEX actor_usr_first_given_name_unaccent_idx;
26 DROP INDEX actor_usr_second_given_name_unaccent_idx;
27 DROP INDEX actor_usr_family_name_unaccent_idx;
28 CREATE INDEX actor_usr_first_given_name_unaccent_idx ON actor.usr
29       (evergreen.unaccent_and_squash(first_given_name));
30 CREATE INDEX actor_usr_second_given_name_unaccent_idx ON actor.usr
31       (evergreen.unaccent_and_squash(second_given_name));
32 CREATE INDEX actor_usr_family_name_unaccent_idx ON actor.usr
33       (evergreen.unaccent_and_squash(family_name));
34 ------------------------------------------------------------------------