Add db-extra-search-path config (#1218)
For adding schemas to the search_path, solves issues related to extensions created in the public schema.
This commit is contained in:
Vendored
+10
@@ -463,3 +463,13 @@ select
|
||||
'last_name_' || generate_series,
|
||||
'2018-10-11'
|
||||
from generate_series(1, 6);
|
||||
|
||||
TRUNCATE TABLE ltree_sample CASCADE;
|
||||
INSERT INTO ltree_sample VALUES ('Top');
|
||||
INSERT INTO ltree_sample VALUES ('Top.Science');
|
||||
INSERT INTO ltree_sample VALUES ('Top.Science.Astronomy');
|
||||
INSERT INTO ltree_sample VALUES ('Top.Science.Astronomy.Astrophysics');
|
||||
INSERT INTO ltree_sample VALUES ('Top.Science.Astronomy.Cosmology');
|
||||
|
||||
TRUNCATE TABLE isn_sample CASCADE;
|
||||
INSERT INTO isn_sample VALUES ('978-0-393-04002-9', 'Mathematics: From the Birth of Numbers');
|
||||
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
set client_min_messages to warning;
|
||||
DROP SCHEMA IF EXISTS test, private, postgrest, jwt, public, تست CASCADE;
|
||||
DROP SCHEMA IF EXISTS test, private, postgrest, jwt, public, تست, extensions CASCADE;
|
||||
DROP TYPE IF EXISTS jwt_token CASCADE;
|
||||
|
||||
Vendored
+3
@@ -5,6 +5,7 @@ GRANT USAGE ON SCHEMA
|
||||
, jwt
|
||||
, public
|
||||
, "تست"
|
||||
, extensions
|
||||
TO postgrest_test_anonymous;
|
||||
|
||||
-- Schema test objects
|
||||
@@ -92,6 +93,8 @@ GRANT ALL ON TABLE
|
||||
, contract
|
||||
, player_view
|
||||
, contract_view
|
||||
, ltree_sample
|
||||
, isn_sample
|
||||
TO postgrest_test_anonymous;
|
||||
|
||||
GRANT INSERT ON TABLE insertonly TO postgrest_test_anonymous;
|
||||
|
||||
Vendored
+25
-4
@@ -17,7 +17,7 @@ CREATE SCHEMA postgrest;
|
||||
CREATE SCHEMA private;
|
||||
CREATE SCHEMA test;
|
||||
CREATE SCHEMA تست;
|
||||
|
||||
CREATE SCHEMA extensions;
|
||||
|
||||
--
|
||||
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
|
||||
@@ -1605,6 +1605,27 @@ create view test.contract_view as select * from test.contract;
|
||||
|
||||
create type public.my_type AS enum ('something');
|
||||
|
||||
CREATE FUNCTION test.test_arg(my_arg public.my_type) RETURNS text AS $$
|
||||
SELECT 'foobar'::text;
|
||||
$$ LANGUAGE sql;
|
||||
create function test.test_arg(my_arg public.my_type) returns text as $$
|
||||
select 'foobar'::text;
|
||||
$$ language sql;
|
||||
|
||||
create extension if not exists ltree with schema public;
|
||||
|
||||
create table test.ltree_sample (
|
||||
path public.ltree
|
||||
);
|
||||
|
||||
CREATE FUNCTION test.number_of_labels(test.ltree_sample) RETURNS integer AS $$
|
||||
SELECT nlevel($1.path)
|
||||
$$ language sql;
|
||||
|
||||
create extension if not exists isn with schema extensions;
|
||||
|
||||
create table test.isn_sample (
|
||||
id extensions.isbn,
|
||||
name text
|
||||
);
|
||||
|
||||
create function test.is_valid_isbn(input text) returns boolean as $$
|
||||
select is_valid(input::isbn);
|
||||
$$ language sql;
|
||||
|
||||
Reference in New Issue
Block a user