Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7e0c205

Browse files
authored
bug: add search path to postgres functions (#449)
1 parente47cf93 commit7e0c205

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎lib/migration_generator/ash_functions.ex‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
1010
CREATE OR REPLACE FUNCTION ash_elixir_or(left BOOLEAN, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE)
1111
AS $$ SELECT COALESCE(NULLIF($1, FALSE), $2) $$
1212
LANGUAGE SQL
13+
SET search_path = ''
1314
IMMUTABLE;
1415
\"\"\")
1516
1617
execute(\"\"\"
1718
CREATE OR REPLACE FUNCTION ash_elixir_or(left ANYCOMPATIBLE, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE)
1819
AS $$ SELECT COALESCE($1, $2) $$
1920
LANGUAGE SQL
21+
SET search_path = ''
2022
IMMUTABLE;
2123
\"\"\")
2224
@@ -27,6 +29,7 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
2729
ELSE $1
2830
END $$
2931
LANGUAGE SQL
32+
SET search_path = ''
3033
IMMUTABLE;
3134
\"\"\")
3235
@@ -37,6 +40,7 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
3740
ELSE $1
3841
END $$
3942
LANGUAGE SQL
43+
SET search_path = ''
4044
IMMUTABLE;
4145
\"\"\")
4246
@@ -62,6 +66,7 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
6266
END IF;
6367
END; $$
6468
LANGUAGE plpgsql
69+
SET search_path = ''
6570
IMMUTABLE;
6671
\"\"\")
6772
@@ -115,6 +120,7 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
115120
END IF;
116121
END; $$
117122
LANGUAGE plpgsql
123+
SET search_path = ''
118124
IMMUTABLE;
119125
\"\"\")
120126
"""
@@ -177,7 +183,8 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
177183
RAISE EXCEPTION '#{prefix}%', json_data::text;
178184
RETURN NULL;
179185
END;
180-
$$ LANGUAGE plpgsql;
186+
$$ LANGUAGE plpgsql
187+
SET search_path = '';
181188
\"\"\")
182189
183190
execute(\"\"\"
@@ -189,7 +196,8 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
189196
RAISE EXCEPTION '#{prefix}%', json_data::text;
190197
RETURN NULL;
191198
END;
192-
$$ LANGUAGE plpgsql;
199+
$$ LANGUAGE plpgsql
200+
SET search_path = '';
193201
\"\"\")
194202
"""
195203
end
@@ -220,6 +228,7 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
220228
END
221229
$$
222230
LANGUAGE PLPGSQL
231+
SET search_path = ''
223232
VOLATILE;
224233
\"\"\")
225234
@@ -230,6 +239,7 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
230239
SELECT to_timestamp(('x0000' || substr(_uuid::TEXT, 1, 8) || substr(_uuid::TEXT, 10, 4))::BIT(64)::BIGINT::NUMERIC / 1000);
231240
$$
232241
LANGUAGE SQL
242+
SET search_path = ''
233243
IMMUTABLE PARALLEL SAFE STRICT;
234244
\"\"\")
235245
"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp