title: Conversion of mysql to psql
body: <p>I am looking for some help in converting mysql script to psql:-</p>
  <pre><code>DROP TRIGGER IF EXISTS TR_Sales_CDC;
   
  DELIMITER ;;
  CREATE TRIGGER TR_Sales_CDC
    AFTER INSERT ON Sales
    FOR EACH ROW
  BEGIN
    SELECT  NEW.ItemID , NEW.Category, New.Price, New.Quantity, New.OrderDate
    , New.DestinationState, New.ShippingType, New.Referral
    INTO @ItemID , @Category, @Price, @Quantity, @OrderDate
    , @DestinationState, @ShippingType, @Referral;
    CALL  CDC_TO_FIREHOSE(@ItemID , @Category, @Price, @Quantity, @OrderDate
    , @DestinationState, @ShippingType, @Referral);
  END
  ;;
  DELIMITER ;
  </code></pre>
  <p>Error after executing this:-</p>
  <pre><code>ERROR:  syntax error at or near &quot;;&quot;
  LINE 1: DROP TRIGGER IF EXISTS TR_Sales_CDC;
                                             ^
  ERROR:  syntax error at or near &quot;DELIMITER&quot;
  LINE 1: DELIMITER ;
          ^
  ERROR:  syntax error at or near &quot;BEGIN&quot;
  LINE 1: ...R TR_Sales_CDC AFTER INSERT ON Sales FOR EACH ROW BEGIN SELE...
                                                               ^
  ERROR:  column &quot;itemid&quot; does not exist
  LINE 1: CALL  CDC_TO_FIREHOSE(@ItemID , @Category, @Price, @Quantity...
                                 ^
  WARNING:  there is no transaction in progress
  COMMIT
  ERROR:  syntax error at or near &quot;DELIMITER&quot;
  LINE 1: DELIMITER ;
  </code></pre>
  <p>Another mysql script:-</p>
  <pre><code>DROP PROCEDURE IF EXISTS CDC_TO_FIREHOSE; DELIMITER ;; CREATE PROCEDURE CDC_TO_FIREHOSE (IN ItemID VARCHAR(255), IN Category varchar(255), IN Price double(10,2), IN Quantity int(11), IN OrderDate timestamp, IN DestinationState varchar(2), IN ShippingType varchar(255), IN Referral  varchar(255)) LANGUAGE SQL BEGIN CALL mysql.lambda_async('arn:aws:lambda:us-east-1:XXXXXXXXXXXXX:function:CDCFromAuroraToKinesis', CONCAT('{ &quot;ItemID&quot; : &quot;', ItemID, '&quot;, &quot;Category&quot; : &quot;', Category, '&quot;, &quot;Price&quot; : &quot;', Price, '&quot;, &quot;Quantity&quot; : &quot;', Quantity, '&quot;, &quot;OrderDate&quot; : &quot;', OrderDate, '&quot;, &quot;DestinationState&quot; : &quot;', DestinationState, '&quot;, &quot;ShippingType&quot; : &quot;', ShippingType, '&quot;, &quot;Referral&quot; : &quot;', Referral, '&quot;}') ); END ;; DELIMITER ;
  </code></pre>
  <p>Error:-</p>
  <pre><code>NOTICE:  procedure cdc_to_firehose() does not exist, skipping
  DROP PROCEDURE
  ERROR:  syntax error at or near &quot;DELIMITER&quot;
  LINE 1: DELIMITER ;
          ^
  ERROR:  syntax error at or near &quot;(&quot;
  LINE 1: ...rchar(255), IN Price double(10,2), IN Quantity int(11), IN O...
                                                               ^
  WARNING:  there is no transaction in progress
  COMMIT
  ERROR:  syntax error at or near &quot;DELIMITER&quot;
  LINE 1: DELIMITER ;
  </code></pre>
  <p>Reference blog-
  <a href="https://aws.amazon.com/blogs/database/capturing-data-changes-in-amazon-aurora-using-aws-lambda/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/database/capturing-data-changes-in-amazon-aurora-using-aws-lambda/</a></p>