public inbox for [email protected]  
help / color / mirror / Atom feed
Trick to create alias/mirror table
8+ messages / 5 participants
[nested] [flat]

* Trick to create alias/mirror table
@ 2024-07-08 11:27 intmail01 <[email protected]>
  2024-07-08 11:55 ` Re: Trick to create alias/mirror table Kashif Zeeshan <[email protected]>
  2024-07-08 12:09 ` Re: Trick to create alias/mirror table [email protected]
  2024-07-08 12:17 ` Re: Trick to create alias/mirror table Achilleas Mantzios - cloud <[email protected]>
  0 siblings, 3 replies; 8+ messages in thread

From: intmail01 @ 2024-07-08 11:27 UTC (permalink / raw)
  To: [email protected]

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


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Trick to create alias/mirror table
  2024-07-08 11:27 Trick to create alias/mirror table intmail01 <[email protected]>
@ 2024-07-08 11:55 ` Kashif Zeeshan <[email protected]>
  2 siblings, 0 replies; 8+ messages in thread

From: Kashif Zeeshan @ 2024-07-08 11:55 UTC (permalink / raw)
  To: intmail01 <[email protected]>; +Cc: [email protected]

Hi

You can use following options

1. Postgres FDW
2. Materialized Views


Regards
Kashif Zeeshan

On Mon, Jul 8, 2024 at 4:25 PM intmail01 <[email protected]> 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.
> 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
>


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Trick to create alias/mirror table
  2024-07-08 11:27 Trick to create alias/mirror table intmail01 <[email protected]>
@ 2024-07-08 12:09 ` [email protected]
  2024-07-08 13:04   ` Re: Trick to create alias/mirror table intmail01 <[email protected]>
  2 siblings, 1 reply; 8+ messages in thread

From: [email protected] @ 2024-07-08 12:09 UTC (permalink / raw)
  To: [email protected]

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.






^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Trick to create alias/mirror table
  2024-07-08 11:27 Trick to create alias/mirror table intmail01 <[email protected]>
  2024-07-08 12:09 ` Re: Trick to create alias/mirror table [email protected]
@ 2024-07-08 13:04   ` intmail01 <[email protected]>
  2024-07-08 13:11     ` Re: Trick to create alias/mirror table David G. Johnston <[email protected]>
  2024-07-08 13:29     ` Re: Trick to create alias/mirror table [email protected]
  2024-07-08 13:44     ` Re: Trick to create alias/mirror table [email protected]
  0 siblings, 3 replies; 8+ messages in thread

From: intmail01 @ 2024-07-08 13:04 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

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.

On Mon, Jul 8, 2024 at 3:09 PM <[email protected]> wrote:

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


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Trick to create alias/mirror table
  2024-07-08 11:27 Trick to create alias/mirror table intmail01 <[email protected]>
  2024-07-08 12:09 ` Re: Trick to create alias/mirror table [email protected]
  2024-07-08 13:04   ` Re: Trick to create alias/mirror table intmail01 <[email protected]>
@ 2024-07-08 13:11     ` David G. Johnston <[email protected]>
  2 siblings, 0 replies; 8+ messages in thread

From: David G. Johnston @ 2024-07-08 13:11 UTC (permalink / raw)
  To: intmail01 <[email protected]>; +Cc: [email protected] <[email protected]>; [email protected] <[email protected]>

On Monday, July 8, 2024, intmail01 <[email protected]> wrote:

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

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.


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Trick to create alias/mirror table
  2024-07-08 11:27 Trick to create alias/mirror table intmail01 <[email protected]>
  2024-07-08 12:09 ` Re: Trick to create alias/mirror table [email protected]
  2024-07-08 13:04   ` Re: Trick to create alias/mirror table intmail01 <[email protected]>
@ 2024-07-08 13:29     ` [email protected]
  2 siblings, 0 replies; 8+ messages in thread

From: [email protected] @ 2024-07-08 13:29 UTC (permalink / raw)
  To: intmail01 <[email protected]>; +Cc: [email protected]

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.







^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Trick to create alias/mirror table
  2024-07-08 11:27 Trick to create alias/mirror table intmail01 <[email protected]>
  2024-07-08 12:09 ` Re: Trick to create alias/mirror table [email protected]
  2024-07-08 13:04   ` Re: Trick to create alias/mirror table intmail01 <[email protected]>
@ 2024-07-08 13:44     ` [email protected]
  2 siblings, 0 replies; 8+ messages in thread

From: [email protected] @ 2024-07-08 13:44 UTC (permalink / raw)
  To: intmail01 <[email protected]>; +Cc: [email protected]

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.

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.






^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Trick to create alias/mirror table
  2024-07-08 11:27 Trick to create alias/mirror table intmail01 <[email protected]>
@ 2024-07-08 12:17 ` Achilleas Mantzios - cloud <[email protected]>
  2 siblings, 0 replies; 8+ messages in thread

From: Achilleas Mantzios - cloud @ 2024-07-08 12:17 UTC (permalink / raw)
  To: [email protected]


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

^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2024-07-08 13:44 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-07-08 11:27 Trick to create alias/mirror table intmail01 <[email protected]>
2024-07-08 11:55 ` Kashif Zeeshan <[email protected]>
2024-07-08 12:09 ` [email protected]
2024-07-08 13:04   ` intmail01 <[email protected]>
2024-07-08 13:11     ` David G. Johnston <[email protected]>
2024-07-08 13:29     ` [email protected]
2024-07-08 13:44     ` [email protected]
2024-07-08 12:17 ` Achilleas Mantzios - cloud <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox