]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Pflichtenhefte: PL/PgSQL-Funktion erst droppen, dann anlegen, wenn Parameter umbenann...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 26 Aug 2013 10:36:04 +0000 (12:36 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 1 Apr 2014 11:10:32 +0000 (13:10 +0200)
Ältere PostgreSQL-Versionen konnten auch mit einem 'CREATE OR REPLACE
FUNCTION...' noch Funktionsparameter umbenennen. Das können neuere
nicht mehr. Daher zuerst droppen und dann anlegen.

sql/Pg-upgrade2/requirement_spec_items_update_trigger_fix2.sql

index 329569de72d66026ede55c5eb517ab9c9e8ccbcc..9f714da7e5976a02ffef904df34b65c15456111c 100644 (file)
@@ -6,7 +6,12 @@
 -- children. item_id is the ID of the item that needs to be updated
 -- (or NULL if the requirement spec itself must be updated/a section
 -- was changed).
 -- children. item_id is the ID of the item that needs to be updated
 -- (or NULL if the requirement spec itself must be updated/a section
 -- was changed).
-CREATE OR REPLACE FUNCTION update_requirement_spec_item_time_estimation(item_id INTEGER, item_requirement_spec_id INTEGER) RETURNS BOOLEAN AS $$
+
+-- This function must be dropped manually because PostgreSQL cannot
+-- rename function parameters with 'CREATE OR REPLACE FUNCTION ...'
+-- anymore.
+DROP FUNCTION update_requirement_spec_item_time_estimation(item_id INTEGER, requirement_spec_id INTEGER);
+CREATE FUNCTION update_requirement_spec_item_time_estimation(item_id INTEGER, item_requirement_spec_id INTEGER) RETURNS BOOLEAN AS $$
   DECLARE
     current_row RECORD;
     new_row     RECORD;
   DECLARE
     current_row RECORD;
     new_row     RECORD;