fix: Allow schema names with special characters in the search path
Fixes regression where the search path did not recognize schemas with uppercase, spaces and other special characters in their names.
This commit is contained in:
Vendored
+3
@@ -795,3 +795,6 @@ INSERT INTO shop_bles(id, name, coords, shop_id, range_area) VALUES(1, 'Beacon-1
|
||||
extensions.ST_GeomFromGeoJSON('{"type": "Polygon", "coordinates": [ [ [ -71.10045254230499, 42.37387083326593 ], [ -71.10048070549963, 42.37377126199953 ], [ -71.10039688646793, 42.37375838212269 ], [ -71.10037006437777, 42.37385844878863 ], [ -71.10045254230499, 42.37387083326593 ] ] ]}'));
|
||||
INSERT INTO shop_bles(id, name, coords, shop_id, range_area) VALUES(2, 'Beacon-2', 'SRID=4326;POINT(-71.10044 42.373695)', 1,
|
||||
extensions.ST_GeomFromGeoJSON('{"type": "Polygon", "coordinates": [ [ [ -71.10034391283989, 42.37385299961788 ], [ -71.10036939382553, 42.373756895982865 ], [ -71.1002916097641, 42.373745997623224 ], [ -71.1002641171217, 42.37384408279195 ], [ -71.10034391283989, 42.37385299961788 ] ] ]}'));
|
||||
|
||||
TRUNCATE TABLE "SPECIAL ""@/\#~_-".names CASCADE;
|
||||
INSERT INTO "SPECIAL ""@/\#~_-".names (id, name) VALUES (1, 'John'), (2, 'Mary');
|
||||
|
||||
Vendored
+3
@@ -8,6 +8,8 @@ GRANT USAGE ON SCHEMA
|
||||
, extensions
|
||||
, v1
|
||||
, v2
|
||||
, "SPECIAL ""@/\#~_-"
|
||||
, "EXTRA ""@/\#~_-"
|
||||
TO postgrest_test_anonymous;
|
||||
|
||||
-- Schema test objects
|
||||
@@ -190,6 +192,7 @@ GRANT ALL ON TABLE
|
||||
, bulk_update_items_cpk
|
||||
, shops
|
||||
, shop_bles
|
||||
, "SPECIAL ""@/\#~_-".names
|
||||
TO postgrest_test_anonymous;
|
||||
|
||||
GRANT INSERT ON TABLE insertonly TO postgrest_test_anonymous;
|
||||
|
||||
Vendored
+15
@@ -20,6 +20,8 @@ CREATE SCHEMA تست;
|
||||
CREATE SCHEMA extensions;
|
||||
CREATE SCHEMA v1;
|
||||
CREATE SCHEMA v2;
|
||||
CREATE SCHEMA "SPECIAL ""@/\#~_-";
|
||||
CREATE SCHEMA "EXTRA ""@/\#~_-";
|
||||
|
||||
COMMENT ON SCHEMA v1 IS 'v1 schema';
|
||||
COMMENT ON SCHEMA v2 IS 'v2 schema';
|
||||
@@ -2669,3 +2671,16 @@ create table shop_bles (
|
||||
create function get_shop(id int) returns shops as $$
|
||||
select * from shops where id = $1;
|
||||
$$ language sql;
|
||||
|
||||
CREATE TABLE "SPECIAL ""@/\#~_-".names(
|
||||
id INT PRIMARY KEY,
|
||||
name TEXT
|
||||
);
|
||||
|
||||
CREATE FUNCTION "EXTRA ""@/\#~_-".get_val_special(val text) RETURNS text AS $$
|
||||
SELECT val;
|
||||
$$ LANGUAGE sql;
|
||||
|
||||
CREATE FUNCTION test.special_extended_schema(val text) RETURNS text AS $$
|
||||
SELECT get_val_special(val);
|
||||
$$ LANGUAGE sql;
|
||||
|
||||
Reference in New Issue
Block a user