Merge pull request #48664 from alyssais/postgres11

postgresql_11: init at 11.0
This commit is contained in:
Lancelot SIX 2018-10-30 15:54:42 +01:00 committed by GitHub
commit f68cf486d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 48 additions and 29 deletions

View File

@ -15,7 +15,7 @@ containers.database =
{ config = { config =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ <xref linkend="opt-services.postgresql.enable"/> = true; { <xref linkend="opt-services.postgresql.enable"/> = true;
<xref linkend="opt-services.postgresql.package"/> = pkgs.postgresql96; <xref linkend="opt-services.postgresql.package"/> = pkgs.postgresql_9_6;
}; };
}; };
</programlisting> </programlisting>

View File

@ -197,10 +197,10 @@ swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
pkgs.emacs pkgs.emacs
]; ];
<xref linkend="opt-services.postgresql.package"/> = pkgs.postgresql90; <xref linkend="opt-services.postgresql.package"/> = pkgs.postgresql_10;
</programlisting> </programlisting>
The latter option definition changes the default PostgreSQL package used The latter option definition changes the default PostgreSQL package used
by NixOSs PostgreSQL service to 9.0. For more information on packages, by NixOSs PostgreSQL service to 10.x. For more information on packages,
including how to add new ones, see <xref linkend="sec-custom-packages"/>. including how to add new ones, see <xref linkend="sec-custom-packages"/>.
</para> </para>
</listitem> </listitem>

View File

@ -145,6 +145,13 @@
format. format.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
The versioned <varname>postgresql</varname> have been renamed to use
underscore number seperators. For example, <varname>postgresql96</varname>
has been renamed to <varname>postgresql_9_6</varname>.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>

View File

@ -55,7 +55,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
example = literalExample "pkgs.postgresql96"; example = literalExample "pkgs.postgresql_9_6";
description = '' description = ''
PostgreSQL package to use. PostgreSQL package to use.
''; '';
@ -118,7 +118,7 @@ in
extraPlugins = mkOption { extraPlugins = mkOption {
type = types.listOf types.path; type = types.listOf types.path;
default = []; default = [];
example = literalExample "[ (pkgs.postgis.override { postgresql = pkgs.postgresql94; }) ]"; example = literalExample "[ (pkgs.postgis.override { postgresql = pkgs.postgresql_9_4; }) ]";
description = '' description = ''
When this list contains elements a new store path is created. When this list contains elements a new store path is created.
PostgreSQL and the elements are symlinked into it. Then pg_config, PostgreSQL and the elements are symlinked into it. Then pg_config,
@ -167,9 +167,9 @@ in
# Note: when changing the default, make it conditional on # Note: when changing the default, make it conditional on
# system.stateVersion to maintain compatibility with existing # system.stateVersion to maintain compatibility with existing
# systems! # systems!
mkDefault (if versionAtLeast config.system.stateVersion "17.09" then pkgs.postgresql96 mkDefault (if versionAtLeast config.system.stateVersion "17.09" then pkgs.postgresql_9_6
else if versionAtLeast config.system.stateVersion "16.03" then pkgs.postgresql95 else if versionAtLeast config.system.stateVersion "16.03" then pkgs.postgresql_9_5
else pkgs.postgresql94); else pkgs.postgresql_9_4);
services.postgresql.dataDir = services.postgresql.dataDir =
mkDefault (if versionAtLeast config.system.stateVersion "17.09" then "/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}" mkDefault (if versionAtLeast config.system.stateVersion "17.09" then "/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}"

View File

@ -27,12 +27,12 @@
<filename>configuration.nix</filename>: <filename>configuration.nix</filename>:
<programlisting> <programlisting>
<xref linkend="opt-services.postgresql.enable"/> = true; <xref linkend="opt-services.postgresql.enable"/> = true;
<xref linkend="opt-services.postgresql.package"/> = pkgs.postgresql94; <xref linkend="opt-services.postgresql.package"/> = pkgs.postgresql_9_4;
</programlisting> </programlisting>
Note that you are required to specify the desired version of PostgreSQL Note that you are required to specify the desired version of PostgreSQL
(e.g. <literal>pkgs.postgresql94</literal>). Since upgrading your PostgreSQL (e.g. <literal>pkgs.postgresql_9_4</literal>). Since upgrading your
version requires a database dump and reload (see below), NixOS cannot PostgreSQL version requires a database dump and reload (see below), NixOS
provide a default value for cannot provide a default value for
<xref linkend="opt-services.postgresql.package"/> such as the most recent <xref linkend="opt-services.postgresql.package"/> such as the most recent
release of PostgreSQL. release of PostgreSQL.
</para> </para>

View File

@ -606,7 +606,7 @@ in
{ config = { config =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ services.postgresql.enable = true; { services.postgresql.enable = true;
services.postgresql.package = pkgs.postgresql96; services.postgresql.package = pkgs.postgresql_9_6;
system.stateVersion = "17.03"; system.stateVersion = "17.03";
}; };

View File

@ -468,7 +468,7 @@ in rec {
{ services.httpd.enable = true; { services.httpd.enable = true;
services.httpd.adminAddr = "foo@example.org"; services.httpd.adminAddr = "foo@example.org";
services.postgresql.enable = true; services.postgresql.enable = true;
services.postgresql.package = pkgs.postgresql93; services.postgresql.package = pkgs.postgresql_9_3;
environment.systemPackages = [ pkgs.php ]; environment.systemPackages = [ pkgs.php ];
}); });
}; };

View File

@ -9,7 +9,7 @@ import ./make-test.nix ({ pkgs, ...} : {
{ pkgs, ... }: { pkgs, ... }:
{ {
services.postgresql = let mypg = pkgs.postgresql100; in { services.postgresql = let mypg = pkgs.postgresql_11; in {
enable = true; enable = true;
package = mypg; package = mypg;
extraPlugins = [ (pkgs.postgis.override { postgresql = mypg; }) ]; extraPlugins = [ (pkgs.postgis.override { postgresql = mypg; }) ];

View File

@ -16,7 +16,7 @@
### NixOS - usage: ### NixOS - usage:
================== ==================
services.postgresql.extraPlugins = [ (pkgs.postgis.override { postgresql = pkgs.postgresql95; }) ]; services.postgresql.extraPlugins = [ (pkgs.postgis.override { postgresql = pkgs.postgresql_9_5; }) ];
### important Postgis implementation details: ### important Postgis implementation details:

View File

@ -99,34 +99,40 @@ let
in { in {
postgresql93 = common { postgresql_9_3 = common {
version = "9.3.24"; version = "9.3.24";
psqlSchema = "9.3"; psqlSchema = "9.3";
sha256 = "1a8dnv16n2rxnbwhqw7c0kjpj3xqvkpwk50kvimj4d917cxaf542"; sha256 = "1a8dnv16n2rxnbwhqw7c0kjpj3xqvkpwk50kvimj4d917cxaf542";
}; };
postgresql94 = common { postgresql_9_4 = common {
version = "9.4.19"; version = "9.4.19";
psqlSchema = "9.4"; psqlSchema = "9.4";
sha256 = "12qn9h47rkn4k41gdbxkkvg0pff43k1113jmhc83f19adc1nnxq3"; sha256 = "12qn9h47rkn4k41gdbxkkvg0pff43k1113jmhc83f19adc1nnxq3";
}; };
postgresql95 = common { postgresql_9_5 = common {
version = "9.5.14"; version = "9.5.14";
psqlSchema = "9.5"; psqlSchema = "9.5";
sha256 = "0k8s62h6qd9p3xlx315j5irniskqsnx1nz4ir5r1yhqp07mdab1y"; sha256 = "0k8s62h6qd9p3xlx315j5irniskqsnx1nz4ir5r1yhqp07mdab1y";
}; };
postgresql96 = common { postgresql_9_6 = common {
version = "9.6.10"; version = "9.6.10";
psqlSchema = "9.6"; psqlSchema = "9.6";
sha256 = "09l4zqs74fqnazdsyln9x657mq3wsbgng9wpvq71yh26cv2sq5c6"; sha256 = "09l4zqs74fqnazdsyln9x657mq3wsbgng9wpvq71yh26cv2sq5c6";
}; };
postgresql100 = common { postgresql_10 = common {
version = "10.5"; version = "10.5";
psqlSchema = "10.0"; psqlSchema = "10.0";
sha256 = "04a07jkvc5s6zgh6jr78149kcjmsxclizsqabjw44ld4j5n633kc"; sha256 = "04a07jkvc5s6zgh6jr78149kcjmsxclizsqabjw44ld4j5n633kc";
}; };
postgresql_11 = common {
version = "11.0";
psqlSchema = "11.0";
sha256 = "0szk9ssfych1wlpyqxz3z6dllg1l6m5labpii8c2r463s01vm6xz";
};
} }

View File

@ -225,6 +225,11 @@ mapAliases ({
piwik = matomo; # added 2018-01-16 piwik = matomo; # added 2018-01-16
pltScheme = racket; # just to be sure pltScheme = racket; # just to be sure
poppler_qt5 = libsForQt5.poppler; # added 2015-12-19 poppler_qt5 = libsForQt5.poppler; # added 2015-12-19
postgresql93 = postgresql_9_3;
postgresql94 = postgresql_9_4;
postgresql95 = postgresql_9_5;
postgresql96 = postgresql_9_6;
postgresql100 = throw "deprecated 2018-10-21: use postgresql_10 instead";
procps-ng = procps; # added 2018-06-08 procps-ng = procps; # added 2018-06-08
prometheus-statsd-bridge = prometheus-statsd-exporter; # added 2017-08-27 prometheus-statsd-bridge = prometheus-statsd-exporter; # added 2017-08-27
pulseaudioLight = pulseaudio; # added 2018-04-25 pulseaudioLight = pulseaudio; # added 2018-04-25

View File

@ -13591,22 +13591,23 @@ with pkgs;
pgbouncer = callPackage ../servers/sql/pgbouncer { }; pgbouncer = callPackage ../servers/sql/pgbouncer { };
pgpool93 = pgpool.override { postgresql = postgresql93; }; pgpool93 = pgpool.override { postgresql = postgresql_9_3; };
pgpool94 = pgpool.override { postgresql = postgresql94; }; pgpool94 = pgpool.override { postgresql = postgresql_9_4; };
pgpool = callPackage ../servers/sql/pgpool { pgpool = callPackage ../servers/sql/pgpool {
pam = if stdenv.isLinux then pam else null; pam = if stdenv.isLinux then pam else null;
libmemcached = null; # Detection is broken upstream libmemcached = null; # Detection is broken upstream
}; };
postgresql = postgresql96; postgresql = postgresql_9_6;
inherit (callPackages ../servers/sql/postgresql { }) inherit (callPackages ../servers/sql/postgresql { })
postgresql93 postgresql_9_3
postgresql94 postgresql_9_4
postgresql95 postgresql_9_5
postgresql96 postgresql_9_6
postgresql100; postgresql_10
postgresql_11;
postgresql_jdbc = callPackage ../servers/sql/postgresql/jdbc { }; postgresql_jdbc = callPackage ../servers/sql/postgresql/jdbc { };