Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-image.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-image.sql,v
diff -u -N -r1.15 -r1.16
--- openacs-4/packages/acs-content-repository/sql/postgresql/content-image.sql	12 Mar 2004 18:48:47 -0000	1.15
+++ openacs-4/packages/acs-content-repository/sql/postgresql/content-image.sql	12 Mar 2004 19:19:46 -0000	1.16
@@ -109,8 +109,8 @@
 -- than the standard package_instantiate_object.  So we don't bother calling define_function_args
 -- here.
 
-create function image__new (varchar,integer,integer,integer,varchar,integer,varchar,varchar,varchar,varchar,boolean,timestamptz,varchar,integer,integer,integer,integer
-  ) returns integer as '
+create or replace function image__new (varchar,integer,integer,integer,varchar,integer,varchar,varchar,varchar,varchar,boolean,timestamptz,varchar,integer,integer,integer,integer)
+returns integer as '
   declare
     new__name		alias for $1;
     new__parent_id	alias for $2; -- default null
@@ -141,7 +141,7 @@
   begin
     new__context_id := new__parent_id;
 
-    if p_package_id is null then
+    if new__package_id is null then
       v_package_id := acs_object__package_id(new__parent_id);
     else
       v_package_id := new__package_id;
@@ -163,7 +163,7 @@
       new__mime_type,
       new__nls_language,
       null,
-      ''file'' -- storage_type,
+      ''file'', -- storage_type
       v_package_id
     );
 
@@ -211,7 +211,7 @@
     return v_item_id;
 end; ' language 'plpgsql';
 
-create function image__new (varchar,integer,integer,integer,varchar,integer,varchar,varchar,varchar,varchar,boolean,timestamptz,varchar,integer,integer,integer
+create or replace function image__new (varchar,integer,integer,integer,varchar,integer,varchar,varchar,varchar,varchar,boolean,timestamptz,varchar,integer,integer,integer
   ) returns integer as '
   declare
     new__name		alias for $1;
@@ -253,7 +253,7 @@
 
 -- DRB's version
 
-create function image__new (varchar,integer,integer,integer,varchar,integer,varchar,varchar,varchar,varchar,varchar,
+create or replace function image__new (varchar,integer,integer,integer,varchar,integer,varchar,varchar,varchar,varchar,varchar,
                             varchar,timestamptz,integer, integer, integer) returns integer as '
   declare
     p_name              alias for $1;
@@ -333,7 +333,7 @@
     return v_item_id;
 end; ' language 'plpgsql';
 
-create function image__new (varchar,integer,integer,integer,varchar,integer,varchar,varchar,varchar,varchar,varchar,
+create or replace function image__new (varchar,integer,integer,integer,varchar,integer,varchar,varchar,varchar,varchar,varchar,
                             varchar,timestamptz,integer, integer) returns integer as '
   declare
     p_name              alias for $1;
@@ -410,7 +410,7 @@
       current_timestamp,
       p_creation_user,
       p_creation_ip,
-      p_package_id
+      v_package_id
     );
 
     insert into images
@@ -454,7 +454,7 @@
 
 end;' language 'plpgsql';
 
-create function image__delete (integer)
+create or replace function image__delete (integer)
 returns integer as '
 declare
   v_item_id		alias for $1;
