Subject: Trick to create alias/mirror table

From: intmail01 <[email-masked]>
Date: Mon, 8 Jul 2024 14:27:37 +0300

Hi,
Looking for a trick to make something like an alias or a mirror table. The
alias can be updated. View is not suitable because it is read only data.
The alias is always linked to the original table. When a modification
occurred in the original table this will be visible in all link tables.

Thanks

---

From: Kashif Zeeshan <[email-masked]>
Date: Mon, 8 Jul 2024 16:55:37 +0500

Hi

You can use following options

1. Postgres FDW
2. Materialized Views

Regards
Kashif Zeeshan

---

From: [email-masked]
Date: Mon, 8 Jul 2024 14:09:30 +0200

intmail01 schrieb am 08.07.2024 um 13:27:
> Hi, Looking for a trick to make something like an alias or a mirror
> table. The alias can be updated. View is not suitable because it is
> read only data. The alias is always linked to the original table.
> When a modification occurred in the original table this will be
> visible in all link tables.

This sounds very much as if a view would solve that requirement.

Views can be updated in Postgres. Either automatically if it's a "simple view"
or by providing a function that handles the DML.

---

From: Achilleas Mantzios - cloud <[email-masked]>
Date: Mon, 8 Jul 2024 15:17:48 +0300

On 7/8/24 14:27, intmail01 wrote:
>
> 	
>
> Hi,
> Looking for a trick to make something like an alias or a mirror table. 
> The alias can be updated.

> View is not suitable because it is read only data.
What? Check out the docs. Views can be perfectly modified.

---

From: intmail01 <[email-masked]>
Date: Mon, 8 Jul 2024 16:04:55 +0300

No. Simple view can not be updated with a GUI like PgAdmin or LibreOffice
Base. Only query code can modify it and every people can not code sql.

---

From: "David G. Johnston" <[email-masked]>
Date: Mon, 8 Jul 2024 06:11:44 -0700

> Base. Only query code can modify it and every people can not code sql.

Fair.  But updatable views are the solution PostgreSQL provides to your use
case.  That client applications aren’t fully exposing it to the user is
unfortunate.  There isn’t another way of doing this aside from having a
bunch of synchronized tables done probably with manual triggers.

David J.

---

From: [email-masked]
Date: Mon, 8 Jul 2024 15:29:39 +0200

intmail01 schrieb am 08.07.2024 um 15:04:
> No. Simple view can not be updated with a GUI like PgAdmin or
> LibreOffice Base. Only query code can modify it and every people can
> not code sql.

Well, that's a bug in those applications and you should file a bug report or enhancment request with those tools.

As a side note: I would never provide an "admin" tool like pgAdmin to end users that have no idea what "SQL" is.

---

From: [email-masked]
Date: Mon, 8 Jul 2024 15:44:21 +0200

> LibreOffice Base. Only query code can modify it and every people can

You might want to look for "no code" or "low code" solutions to provide an end-user friendly GUI to edit the data.

Tools in that direction that I have came across, but have never tried are SQLPage, NocoDB or Budibase.

Using a tool like that might even remove the need to "shield" the actual tables through views.