A column with a trigger is not updated when a data change is made through the Data Output section

オープン
#9,598 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
postgresql, python
領域
database, frontend

調査の方向性

Reproduce the issue in pgAdmin's Data Output section using the supplied PostgreSQL table, trigger, and INSERT/UPDATE steps. Start with the Save Data Changes flow and compare the edited row with the database result after the trigger runs. Done means the Data Output section refreshes the trigger-updated date column immediately after saving, without requiring a separate SELECT.

索引モデルが issue の本文から書いたものです。

説明

Feature

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 on another column.

Here are my pgAdmin infos :

  • Version : 9.11
  • Application Mode : Desktop
  • Commit : dc801e362ebde7fe59ecf77eaaab740fe7452cc5 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

  1. 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
);
  1. 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();
  1. Do an INSERT query :
INSERT INTO mytable VALUES (DEFAULT, 'Something', current_timestamp);
  1. Do a SELECT query :
SELECT * FROM mytable;

🟢 Seen & expected behavior :

  • the inserted row can be seen in the "Data Output" section
  • the date column has been correctly filled (by the trigger) and is correctly displayed
Image
  1. Change the value of one of the columns (but not the date one) through the "Data Output" section

  2. 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

Image
  1. Do a SELECT query
SELECT * FROM mytable;

🟢 Seen & expected behavior :

  • the edited row can be seen in the "Data Output" section
  • the date column is now correctly displayed (with its updated value)
Image

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).

主要言語
Python
スター
3.9k
フォーク
922
平均マージ
2日 3時間
マージ済み PR(30日)
33

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pgadmin-org/pgadmin4 のほかの issue

pgadmin-org/pgadmin4 の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。