pgadmin-org / pgadmin-org/pgadmin4

Generated always columns are not properly handled in View/Edit Data

Open
#9,672 0 comments 0 reactions 1 assignee View on GitHub

@RohitBhati8269 is already working on this.

Since Mar 16, 2026.

Bug
Dominant language
Python
Stars
3.8k
Forks
891
Avg merge
4d 7h
Merged PRs (30d)
8

Description

Generated always columns are not properly handled in View/Edit Data

Editing data in tables which includes one (or more) generated always column can be a nightmare.

If by accident you change the value of one such column(s), there seem to be no way to reset its value to "[default]". As a consequence, you cannot save your (other, wanted) changes since obviously that will result in an error:

cannot insert a non-DEFAULT value into column "...."
Column "...." is a generated column.

As a consequence, you can not e.g. add row(s) to such a table by duplicating existing ones (copy/paste a row) and and then change the values in some of the (non generated) columns.

A similar issue exists when Importing Data from CSV files, though that perhaps can be handled by selecting which columns to import (but I am afraid that can work only if the generated column(s) are the very last one(s), after all the "normal" ones).

To Reproduce

Trivial:

  1. Create a table including PK, some normal columns and at least one generated column (GENERATED ALWAYS AS ...);
  2. Open it in the View/Edit Data tool;
  3. Select a row;
  4. Click on the "Copy" icon;
  5. Click on the "Paste" icon;
  6. Change some of the non-generated columns (pkey and whatever);
  7. try to save ==> Error
  8. would like to change the generate column to "[default]" to avoid that error: can't fine any way to do so.

Expected behavior

  • Generated columns should be handled properly: attempts to directly change their value to anything but "DEFAULT" should be disabled, and any value pasted into them should be ignored (otherwise copy/paste of a whole row would be impossible).

  • Queries generated by View/Edit Data must properly handle generated always columns in insert / update queries (always set them to DEFAULT, regardless of the corresponding cell content in the GUI).

  • Right-clicking on any "cell" should give the possibility to reset its value to [default] (and [null] as well).

Other possible (unrelated) improvement:

  • cell selections should obey the standard modifiers: Shift to select a range of "cells", Ctrl to add a column to the existing selection, ecc.

Desktop (please complete the following information):

  • OS: Debian GNU/Linux 13 (trixie)
  • DE : KDE Plasma
  • pgAdmin version: 9.12
  • Mode: Desktop
  • Package type: DEB (from ftp.postgresql.org repository)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.