-
Notifications
You must be signed in to change notification settings - Fork 821
Open
Labels
Description
Hi !
1. What
I think that a column with a trigger is not updated in the Data Output section after a Data Change has been made.
Here are my pgAdmin infos :
- Version : 9.11
- Application Mode : Desktop
- Commit : dc801e3 2025-12-08
- Python Version : 3.14.1
- Browser : Chrome 143.0.0.0
- Operating System : Alpine Linux v3.23, Linux-6.12.10-76061203-generic-x86_64-with-musl1
2. How
- Create a new table with a few columns, including one date column
CREATE TABLE mytable (
id SERIAL PRIMARY KEY,
value TEXT,
date TIMESTAMP WITH TIME ZONE
);
- Add a trigger to this table :
CREATE OR REPLACE FUNCTION public.myfunction()
RETURNS TRIGGER AS $$
BEGIN
NEW.date = NOW();
RETURN NEW;
END;
$$ language 'plpgsql';
CREATE OR REPLACE TRIGGER mytrigger
BEFORE INSERT OR UPDATE ON mytable
FOR EACH ROW EXECUTE FUNCTION myfunction();
- Do an
INSERTquery :
INSERT INTO mytable VALUES (DEFAULT, 'Something', current_timestamp);
- Do a
SELECTquery :
SELECT * FROM mytable;
🟢 Seen & expected behavior :
- the inserted row can be seen in the "Data Output" section
- the
datecolumn has been correctly filled (by the trigger) and is correctly displayed
-
Change the value of one of the columns (but not the
dateone) through the "Data Output" section -
Press the "Save Data Changes" button
🔴 Seen behavior : only the edited column is up to date in the "Data Output" section
Expected behavior : the date column should be up to date as well
- Do a
SELECTquery
SELECT * FROM mytable;
🟢 Seen & expected behavior :
- the edited row can be seen in the "Data Output" section
- the
datecolumn is now correctly displayed (with its updated value)
3. Why
It seems that, after a successful "Data Change", pgAdmin doesn't get the last known value of the row (or of the other attributes of the row). It only updates the modified cell(s).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status