From 18df3368ef988895cc884591888e6c5557d6b28d Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Tue, 20 Dec 2016 11:47:51 +0100 Subject: [PATCH] Set search path before installing/update the extension See #324 --- client/sql/00_header.sql | 3 +++ client/upgrade_downgrade_template.erb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/client/sql/00_header.sql b/client/sql/00_header.sql index 65eb4bf..b41a51c 100644 --- a/client/sql/00_header.sql +++ b/client/sql/00_header.sql @@ -1,3 +1,6 @@ --DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES -- Complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION cdb_dataservices_client" to load this file. \quit + +-- Make sure we have a sane search path to create/update the extension +SET search_path = "$user",public,cdb_dataservices_client; diff --git a/client/upgrade_downgrade_template.erb b/client/upgrade_downgrade_template.erb index bc8eb7c..31be973 100644 --- a/client/upgrade_downgrade_template.erb +++ b/client/upgrade_downgrade_template.erb @@ -2,4 +2,7 @@ -- Complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "ALTER EXTENSION cdb_dataservices_client UPDATE TO '<%= version %>'" to load this file. \quit +-- Make sure we have a sane search path to create/update the extension +SET search_path = "$user",public,cdb_dataservices_client; + -- HERE goes your code to upgrade/downgrade