From 63588967b9057e8f8a33d446752d2e7475b15044 Mon Sep 17 00:00:00 2001 From: Roland Weisleder Date: Thu, 26 Dec 2019 13:15:17 +0100 Subject: [PATCH] Sakila/PostgreSQL: Don't fail if language plpgsql already exists When using the Sakila DB with the Docker image postgres:12.1 the initialisation fails with: ERROR: language "plpgsql" already exists With PostgreSQL 8.4 (see [1]) and earlier it was only possible to execute: CREATE [ PROCEDURAL ] LANGUAGE name Starting with PostgreSQL 9.0 (see [2]) it is possible to execute: CREATE [ OR REPLACE ] [ PROCEDURAL ] LANGUAGE name This commit makes the SQL script incompatible with PostgreSQL 8.4 and earlier. [1] https://www.postgresql.org/docs/8.4/sql-createlanguage.html [2] https://www.postgresql.org/docs/9.0/sql-createlanguage.html --- .../Sakila/postgres-sakila-db/postgres-sakila-schema.sql | 2 +- jOOQ/src/main/resources/META-INF/ABOUT.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jOOQ-examples/Sakila/postgres-sakila-db/postgres-sakila-schema.sql b/jOOQ-examples/Sakila/postgres-sakila-db/postgres-sakila-schema.sql index bf40db1a9f..82016f471f 100644 --- a/jOOQ-examples/Sakila/postgres-sakila-db/postgres-sakila-schema.sql +++ b/jOOQ-examples/Sakila/postgres-sakila-db/postgres-sakila-schema.sql @@ -19,7 +19,7 @@ COMMENT ON SCHEMA public IS 'Standard public schema'; -- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres -- -CREATE PROCEDURAL LANGUAGE plpgsql; +CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql; ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres; diff --git a/jOOQ/src/main/resources/META-INF/ABOUT.txt b/jOOQ/src/main/resources/META-INF/ABOUT.txt index 282dfcfb7c..8023090f4f 100644 --- a/jOOQ/src/main/resources/META-INF/ABOUT.txt +++ b/jOOQ/src/main/resources/META-INF/ABOUT.txt @@ -40,6 +40,7 @@ Authors and contributors of jOOQ or parts of jOOQ in alphabetical order: - Peter Ertl - Richard Bradley - Robin Stocker +- Roland Weisleder - Samy Deghou - Sander Plas - Sean Wellington