pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: How to write such a query
Date: Fri, 18 Sep 2020 22:26:18 +0200
Message-ID: <de9a6288-72a3-3638-ecc2-672d274de717@gmx.net> (raw)
In-Reply-To: <CA+FnnTwRr2VbwQSd71jnAtNrgAMqO57AmTO-OqeA6Te-mjMORQ@mail.gmail.com>
References: <CA+FnnTzwZv4x8cuLWYBoOJecaXS1qFOaLPrkopF-LWkKoBNP1w@mail.gmail.com>
	<CAK8Y=HV826Qw-1tPNOZwCnz+sNqYio8tvGDFW+4jPwL4NRDfKg@mail.gmail.com>
	<CA+FnnTw9om1qTBSpzb9tsZWqj0r6ebpENj-jCtxmvhDAoRBdEA@mail.gmail.com>
	<912dd33c-c837-a226-111f-413fcb7321c1@aklaver.com>
	<CA+FnnTwPFb2ru4JkJdbyGo9+9U+bOPRTAt991qhqSMx7adrbEQ@mail.gmail.com>
	<f3ac3c95-4935-6662-27ad-a025093b5af3@gmail.com>
	<CAD3a31XmfCqz-p7Ssky53U7m4fkL0RHGZyM=RVfD5+K-RZ69Gw@mail.gmail.com>
	<CA+FnnTwRr2VbwQSd71jnAtNrgAMqO57AmTO-OqeA6Te-mjMORQ@mail.gmail.com>

Igor Korot schrieb am 18.09.2020 um 22:18:
> Thank you for the info.
> My problem is that I want to emulate Access behavior.
>
> As I said - Access does it without changing the query internally (I presume).
>
> I want to do the same with PostgreSQL.
>
> I'm just trying to understand how to make it work for any query
>
> I can have 3,4,5 tables, query them and then update the Nth record in the resulting recordset.
>
> Access does it, PowerBuilder does it.

I assume that they query the database to find the primary key for the table in question.
Once the primary key columns are known (and part of the result), they generate the appropriate
UPDATE statement with a WHERE clause based on the the values in the result to update
the row that was changed.

Thomas





view thread (36+ messages)  latest in thread

Message-ID: <de9a6288-72a3-3638-ecc2-672d274de717@gmx.net>
Permalink:  ../de9a6288-72a3-3638-ecc2-672d274de717@gmx.net/
Also on:    postgresql.org/message-id/de9a6288-72a3-3638-ecc2-672d274de717@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: shammat@gmx.net
  Subject: Re: How to write such a query
  In-Reply-To: <de9a6288-72a3-3638-ecc2-672d274de717@gmx.net>
  References: <CA+FnnTzwZv4x8cuLWYBoOJecaXS1qFOaLPrkopF-LWkKoBNP1w@mail.gmail.com> <CAK8Y=HV826Qw-1tPNOZwCnz+sNqYio8tvGDFW+4jPwL4NRDfKg@mail.gmail.com> <CA+FnnTw9om1qTBSpzb9tsZWqj0r6ebpENj-jCtxmvhDAoRBdEA@mail.gmail.com> <912dd33c-c837-a226-111f-413fcb7321c1@aklaver.com> <CA+FnnTwPFb2ru4JkJdbyGo9+9U+bOPRTAt991qhqSMx7adrbEQ@mail.gmail.com> <f3ac3c95-4935-6662-27ad-a025093b5af3@gmail.com> <CAD3a31XmfCqz-p7Ssky53U7m4fkL0RHGZyM=RVfD5+K-RZ69Gw@mail.gmail.com> <CA+FnnTwRr2VbwQSd71jnAtNrgAMqO57AmTO-OqeA6Te-mjMORQ@mail.gmail.com> <de9a6288-72a3-3638-ecc2-672d274de717@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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