functext_c_3 | t
(3 rows)
---
--- COST
---
-CREATE FUNCTION functext_D_1(int,int) RETURNS int LANGUAGE 'sql'
- AS 'SELECT $1 + $2';
-CREATE FUNCTION functext_D_2(int,int) RETURNS int LANGUAGE 'internal'
- AS 'int4pl';
-CREATE FUNCTION functext_D_3(int,int) RETURNS int LANGUAGE 'sql'
- COST 500 AS 'SELECT $1 * $2';
-CREATE FUNCTION functext_D_4(int,int) RETURNS int LANGUAGE 'sql'
- COST 0 AS 'SELECT $1 / $2'; -- Error
-ERROR: COST must be positive
-SELECT proname, procost FROM pg_proc
- WHERE oid in ('functext_D_1'::regproc,
- 'functext_D_2'::regproc,
- 'functext_D_3'::regproc) ORDER BY proname;
- proname | procost
---------------+---------
- functext_d_1 | 100
- functext_d_2 | 1
- functext_d_3 | 500
-(3 rows)
-
-ALTER FUNCTION functext_D_1(int,int) STABLE; -- unrelated change, no effect
-ALTER FUNCTION functext_D_2(int,int) COST 50;
-ALTER FUNCTION functext_D_3(int,int) COST 0.0001;
-SELECT proname, procost FROM pg_proc
- WHERE oid in ('functext_D_1'::regproc,
- 'functext_D_2'::regproc,
- 'functext_D_3'::regproc) ORDER BY proname;
- proname | procost
---------------+---------
- functext_d_1 | 100
- functext_d_2 | 50
- functext_d_3 | 0.0001
-(3 rows)
-
--
-- LEAKPROOF
--
-- Cleanups
DROP SCHEMA temp_func_test CASCADE;
-NOTICE: drop cascades to 19 other objects
+NOTICE: drop cascades to 16 other objects
DETAIL: drop cascades to function functest_a_1(text,date)
drop cascades to function functest_a_2(text[])
drop cascades to function functest_a_3()
drop cascades to function functext_c_1(integer)
drop cascades to function functext_c_2(integer)
drop cascades to function functext_c_3(integer)
-drop cascades to function functext_d_1(integer,integer)
-drop cascades to function functext_d_2(integer,integer)
-drop cascades to function functext_d_3(integer,integer)
drop cascades to function functext_e_1(integer)
drop cascades to function functext_e_2(integer)
drop cascades to function functext_f_1(integer)
'functext_C_2'::regproc,
'functext_C_3'::regproc) ORDER BY proname;
---
--- COST
---
-CREATE FUNCTION functext_D_1(int,int) RETURNS int LANGUAGE 'sql'
- AS 'SELECT $1 + $2';
-CREATE FUNCTION functext_D_2(int,int) RETURNS int LANGUAGE 'internal'
- AS 'int4pl';
-CREATE FUNCTION functext_D_3(int,int) RETURNS int LANGUAGE 'sql'
- COST 500 AS 'SELECT $1 * $2';
-CREATE FUNCTION functext_D_4(int,int) RETURNS int LANGUAGE 'sql'
- COST 0 AS 'SELECT $1 / $2'; -- Error
-SELECT proname, procost FROM pg_proc
- WHERE oid in ('functext_D_1'::regproc,
- 'functext_D_2'::regproc,
- 'functext_D_3'::regproc) ORDER BY proname;
-
-ALTER FUNCTION functext_D_1(int,int) STABLE; -- unrelated change, no effect
-ALTER FUNCTION functext_D_2(int,int) COST 50;
-ALTER FUNCTION functext_D_3(int,int) COST 0.0001;
-SELECT proname, procost FROM pg_proc
- WHERE oid in ('functext_D_1'::regproc,
- 'functext_D_2'::regproc,
- 'functext_D_3'::regproc) ORDER BY proname;
-
--
-- LEAKPROOF
--