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

Commit7cd56f2

Browse files
committed
Add tests for pg_get_functiondef
1 parenta7b8f06 commit7cd56f2

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

‎src/test/regress/expected/create_function_3.out

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,50 @@ SELECT proname, proisstrict FROM pg_proc
189189
functest_f_4 | t
190190
(4 rows)
191191

192+
-- pg_get_functiondef tests
193+
SELECT pg_get_functiondef('functest_A_1'::regproc);
194+
pg_get_functiondef
195+
--------------------------------------------------------------------
196+
CREATE OR REPLACE FUNCTION temp_func_test.functest_a_1(text, date)+
197+
RETURNS boolean +
198+
LANGUAGE sql +
199+
AS $function$SELECT $1 = 'abcd' AND $2 > '2001-01-01'$function$ +
200+
201+
(1 row)
202+
203+
SELECT pg_get_functiondef('functest_B_3'::regproc);
204+
pg_get_functiondef
205+
-----------------------------------------------------------------
206+
CREATE OR REPLACE FUNCTION temp_func_test.functest_b_3(integer)+
207+
RETURNS boolean +
208+
LANGUAGE sql +
209+
STABLE +
210+
AS $function$SELECT $1 = 0$function$ +
211+
212+
(1 row)
213+
214+
SELECT pg_get_functiondef('functest_C_3'::regproc);
215+
pg_get_functiondef
216+
-----------------------------------------------------------------
217+
CREATE OR REPLACE FUNCTION temp_func_test.functest_c_3(integer)+
218+
RETURNS boolean +
219+
LANGUAGE sql +
220+
SECURITY DEFINER +
221+
AS $function$SELECT $1 < 0$function$ +
222+
223+
(1 row)
224+
225+
SELECT pg_get_functiondef('functest_F_2'::regproc);
226+
pg_get_functiondef
227+
-----------------------------------------------------------------
228+
CREATE OR REPLACE FUNCTION temp_func_test.functest_f_2(integer)+
229+
RETURNS boolean +
230+
LANGUAGE sql +
231+
STRICT +
232+
AS $function$SELECT $1 = 50$function$ +
233+
234+
(1 row)
235+
192236
-- information_schema tests
193237
CREATE FUNCTION functest_IS_1(a int, b int default 1, c text default 'foo')
194238
RETURNS int

‎src/test/regress/sql/create_function_3.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ SELECT proname, proisstrict FROM pg_proc
134134
'functest_F_4'::regproc)ORDER BY proname;
135135

136136

137+
-- pg_get_functiondef tests
138+
139+
SELECT pg_get_functiondef('functest_A_1'::regproc);
140+
SELECT pg_get_functiondef('functest_B_3'::regproc);
141+
SELECT pg_get_functiondef('functest_C_3'::regproc);
142+
SELECT pg_get_functiondef('functest_F_2'::regproc);
143+
144+
137145
-- information_schema tests
138146

139147
CREATEFUNCTIONfunctest_IS_1(aint, bint default1, ctext default'foo')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp