Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7cd56f21
Commit
7cd56f21
authored
Feb 12, 2018
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for pg_get_functiondef
parent
a7b8f066
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
src/test/regress/expected/create_function_3.out
src/test/regress/expected/create_function_3.out
+44
-0
src/test/regress/sql/create_function_3.sql
src/test/regress/sql/create_function_3.sql
+8
-0
No files found.
src/test/regress/expected/create_function_3.out
View file @
7cd56f21
...
@@ -189,6 +189,50 @@ SELECT proname, proisstrict FROM pg_proc
...
@@ -189,6 +189,50 @@ SELECT proname, proisstrict FROM pg_proc
functest_f_4 | t
functest_f_4 | t
(4 rows)
(4 rows)
-- pg_get_functiondef tests
SELECT pg_get_functiondef('functest_A_1'::regproc);
pg_get_functiondef
--------------------------------------------------------------------
CREATE OR REPLACE FUNCTION temp_func_test.functest_a_1(text, date)+
RETURNS boolean +
LANGUAGE sql +
AS $function$SELECT $1 = 'abcd' AND $2 > '2001-01-01'$function$ +
(1 row)
SELECT pg_get_functiondef('functest_B_3'::regproc);
pg_get_functiondef
-----------------------------------------------------------------
CREATE OR REPLACE FUNCTION temp_func_test.functest_b_3(integer)+
RETURNS boolean +
LANGUAGE sql +
STABLE +
AS $function$SELECT $1 = 0$function$ +
(1 row)
SELECT pg_get_functiondef('functest_C_3'::regproc);
pg_get_functiondef
-----------------------------------------------------------------
CREATE OR REPLACE FUNCTION temp_func_test.functest_c_3(integer)+
RETURNS boolean +
LANGUAGE sql +
SECURITY DEFINER +
AS $function$SELECT $1 < 0$function$ +
(1 row)
SELECT pg_get_functiondef('functest_F_2'::regproc);
pg_get_functiondef
-----------------------------------------------------------------
CREATE OR REPLACE FUNCTION temp_func_test.functest_f_2(integer)+
RETURNS boolean +
LANGUAGE sql +
STRICT +
AS $function$SELECT $1 = 50$function$ +
(1 row)
-- information_schema tests
-- information_schema tests
CREATE FUNCTION functest_IS_1(a int, b int default 1, c text default 'foo')
CREATE FUNCTION functest_IS_1(a int, b int default 1, c text default 'foo')
RETURNS int
RETURNS int
...
...
src/test/regress/sql/create_function_3.sql
View file @
7cd56f21
...
@@ -134,6 +134,14 @@ SELECT proname, proisstrict FROM pg_proc
...
@@ -134,6 +134,14 @@ SELECT proname, proisstrict FROM pg_proc
'functest_F_4'
::
regproc
)
ORDER
BY
proname
;
'functest_F_4'
::
regproc
)
ORDER
BY
proname
;
-- pg_get_functiondef tests
SELECT
pg_get_functiondef
(
'functest_A_1'
::
regproc
);
SELECT
pg_get_functiondef
(
'functest_B_3'
::
regproc
);
SELECT
pg_get_functiondef
(
'functest_C_3'
::
regproc
);
SELECT
pg_get_functiondef
(
'functest_F_2'
::
regproc
);
-- information_schema tests
-- information_schema tests
CREATE
FUNCTION
functest_IS_1
(
a
int
,
b
int
default
1
,
c
text
default
'foo'
)
CREATE
FUNCTION
functest_IS_1
(
a
int
,
b
int
default
1
,
c
text
default
'foo'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment