title: Call postgresql stored procedure with composite type array with uuid as one of the input parameters
body: <p>I have the below user defined composite Type</p>
  <pre><code>CREATE TYPE item AS (
      SKU_REFERENCE_ID uuid, 
      QUANTITY INTEGER
  );
  </code></pre>
  <p>And I used it as part of the input parameters of a postgresql stored procedure (showing only relevant part of stored proc)</p>
  <pre><code>CREATE OR REPLACE PROCEDURE &quot;dbo&quot;.&quot;sp_bulk_update_customer_cart&quot; (IN USER_NAME VARCHAR(20), IN CUSTOMER_ITEMS item[], INOUT QUANTITY INTEGER)
  </code></pre>
  <p>However, I am unable to call the procedure.
  Here are some things I tried which all failed:</p>
  <p>Attempt 1:</p>
  <pre><code>CALL dbo.sp_bulk_update_customer_cart(
      'username',
      (ARRAY['(e3903331-ce0b-4bd5-a853-ec7aa725a812, 20)','(ccbecc39-11bd-4bc4-97d6-7e2f981d30dd, 40)'])::item[], 
      0
  );
  </code></pre>
  <p>Attempt 2:</p>
  <pre><code>CALL dbo.sp_bulk_update_customer_cart(
      'username',
      '{&quot;(e3903331-ce0b-4bd5-a853-ec7aa725a812, 20)&quot;,&quot;(ccbecc39-11bd-4bc4-97d6-7e2f981d30dd, 40)&quot;}'::item[], 
      0
  );
  </code></pre>
  <p>Attempt 3:</p>
  <pre><code>CALL dbo.sp_bulk_update_customer_cart(
      'username',
      (SELECT ARRAY[ROW('e3903331-ce0b-4bd5-a853-ec7aa725a812', 20),ROW('ccbecc39-11bd-4bc4-97d6-7e2f981d30dd', 40)]::item[]), 
      0
  );
  </code></pre>
  <p>Most common error I get is</p>
  <blockquote>
  <p>ERROR:  invalid input syntax for type uuid:
  &quot;(e3903331-ce0b-4bd5-a853-ec7aa725a812,20)&quot; CONTEXT:  PL/pgSQL
  function dbo.sp_bulk_update_customer_cart(character
  varying,item[],integer) line 17 at FOR over SELECT rows SQL state:
  22P02</p>
  </blockquote>
  <p>Looking for assistance here.</p>
  <blockquote>
  <p>Using AWS RDS postgres engine version: 13.3</p>
  </blockquote>
  <p>test script:</p>
  <pre><code>DROP PROCEDURE IF EXISTS &quot;dbo&quot;.&quot;sp_test_script&quot;;
  
  --Not really required as temp tables are deleted after the session ends.
  DROP TABLE IF EXISTS item_table;
  
  DROP TYPE IF EXISTS item;
  
  CREATE TYPE item AS (SKU_REFERENCE_ID uuid, QUANTITY integer);
  
  CREATE OR REPLACE PROCEDURE &quot;dbo&quot;.&quot;sp_test_script&quot; (IN USER_NAME VARCHAR(20), IN CUSTOMER_ITEMS item[], INOUT QUANTITY INTEGER) 
  
  LANGUAGE PLPGSQL 
      
  AS $$
  
  BEGIN
  
      CREATE TEMP TABLE item_table (
      id SERIAL PRIMARY KEY NOT NULL,
      SKU_REFERENCE_ID uuid, 
      QUANTITY integer
      );
      
      DECLARE b item;
  
      BEGIN
          FOR b IN SELECT UNNEST(customer_items)
              LOOP
                  RAISE NOTICE 'b.sku_reference_id: %', b.sku_reference_id; 
                  RAISE NOTICE 'b.quantity: %', b.quantity;
                  INSERT INTO item_table(SKU_REFERENCE_ID, QUANTITY) VALUES(b.sku_reference_id, b.quantity);
              END LOOP;
      END;
  
  END; $$;
  </code></pre>