public inbox for [email protected]
help / color / mirror / Atom feedFrom: Vik Fearing <[email protected]>
To: Marcos Pegoraro <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: jian he <[email protected]>
Cc: Dean Rasheed <[email protected]>
Subject: Re: Virtual generated columns
Date: Wed, 8 Jan 2025 20:23:35 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAB-JLwZH-1f1E-idG_oFviRACELhhyAgq+J4m6KUzBNpe6cDGg@mail.gmail.com>
References: <[email protected]>
<[email protected]>
<[email protected]>
<CAEZATCV=RX0M58-uqSR6tFjwQAFnEcx3hvW-9ZZfRQJLg5LzRw@mail.gmail.com>
<[email protected]>
<CAEZATCU3q=znAL7X1aSxuMpjfSyB1cT5j398HPb9ix9ci_HUqA@mail.gmail.com>
<[email protected]>
<CAEZATCVLfMzNwT1J0bnvtv6YbmNSN9QSXb+1QSGyX6vK4q67Ow@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<CAEZATCUHnmOu7RtDuP+PCtS_dqvU8hFsAYYFPdiB8gyFszj5WQ@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<CAB-JLwZH-1f1E-idG_oFviRACELhhyAgq+J4m6KUzBNpe6cDGg@mail.gmail.com>
On 08/01/2025 20:19, Marcos Pegoraro wrote:
> Em qua., 8 de jan. de 2025 às 13:14, Peter Eisentraut
> <[email protected]> escreveu:
>
> Here is a new patch version where I have gathered various pieces of
> feedback and improvement suggestions that are scattered over this
> thread. I hope I got them all. I will respond to the respective
> messages directly to give my response to each item.
>
>
> This new version you are not accepting subqueries, like previous ones.
> But we can create an immutable SQL function which will do the same.
> Wouldn't it be better to explain that on DOCs ?
>
> create table Orders(Order_ID integer not null primary key, Customer_ID
> integer references Customer);
> create function lkCustomer(integer) returns text language sql
> immutable as $function$select Name from Customer where Customer_ID =
> $1;$function$;
> alter table Orders add lkCustomer text generated always as
> (lkCustomer(Customer_ID)) stored;
This is lying to the planner, and you get to enjoy whatever breaks
because of it. A function that accesses external data is not immutable;
it is stable at best.
--
Vik Fearing
view thread (75+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Virtual generated columns
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox