× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
JennyNishimura reported 2017-05-22T20:02:28Z  · tariqrahiman last modified 2017-05-31T18:30:44Z

PostgreSQL: Trigger -> Script Object doesn't script UPDATE OF clause


customer request
Dev
Jenny Nishimura
JennyNishimura
QA
Tariq Rahiman
tariqrahiman
Priority Major
Complexity Unknown
Component DB - PostgreSQL
Version 18.0

1. Connect to PostgreSQL 9.x and run the following DDL statements.

CREATE TABLE test_table (
  id INTEGER NOT NULL,
  name VARCHAR(50) NOT NULL,
  updated_on TIMESTAMP
)
go
CREATE OR REPLACE FUNCTION log_test_changes() RETURNS TRIGGER AS
$$
BEGIN
  IF NEW.name <> OLD.name THEN
    UPDATE test_table SET updated_on=now() WHERE id=OLD.id;
  END IF;
  RETURN NEW;
END;
$$ LANGUAGE plpgsql
go
CREATE TRIGGER test_name_changes
  BEFORE UPDATE OF name
  ON test_table
  FOR EACH ROW
  EXECUTE PROCEDURE log_test_changes()
go

2. Go to the Triggers node in the schema browser.

3. Select "test_name_changes" and bring up the pop-up menu.

Trigger Properties displays the following:

CREATE TRIGGER test_name_changes
BEFORE UPDATE ON public.test_table FOR EACH ROW
EXECUTE PROCEDURE log_test_changes()
Script Object -> CREATE scripts the following:
CREATE TRIGGER "test_name_changes"
   BEFORE UPDATE ON public.test_table FOR EACH ROW
    EXECUTE PROCEDURE log_test_changes()
GO

In both cases, the "UPDATE" clause is missing the column: UPDATE OF name

2 attachments

Issue #15259

Closed
Fixed
Resolved 2017-05-26T18:39:00Z
 
 
Completion
No due date
Fixed Build ADS 18.0.13-1, 19.0.0-alpha-16
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017