public inbox for [email protected]  
help / color / mirror / Atom feed
From: Pavel Luzanov <[email protected]>
To: Pavel Stehule <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Pavel Golub <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: [HACKERS] proposal: schema variables
Date: Mon, 12 Mar 2018 09:49:29 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFj8pRA6YWwV=sZj5iSgDUixr-S+u9W2+v0BJqqxHQDXS2oZww@mail.gmail.com>
References: <CAFj8pRDY+m9OOxfO10R7J0PAkCCauM-TweaTrdsrsLGMb1VbEQ@mail.gmail.com>
	<[email protected]>
	<CAFj8pRDdS7ViLBJ6eA93u=C_x15EBv2deiNQDGkBS=LNrjzLLw@mail.gmail.com>
	<CAFj8pRBfb-GTZSHSRVTpMzGr26-7e-_RmOmRpmuk+xuDTgC=mA@mail.gmail.com>
	<CAKFQuwa00-4HTujbnYNy_OdZ2OfjUO3AX4R91DbQ1wPBZegCfg@mail.gmail.com>
	<CAFj8pRBchBfyPKAVPnJKhDjh7r6kTJ9L1=etMt-pjdDzpsKOUA@mail.gmail.com>
	<CAFj8pRCTsxzsxX1cWgX3cjqsSZb=gqOMd3-2FdbGz5a2+shGMg@mail.gmail.com>
	<CAFj8pRA6YWwV=sZj5iSgDUixr-S+u9W2+v0BJqqxHQDXS2oZww@mail.gmail.com>

Hi,

I plan to make usability and feature test review in several days.

Is there any chances that it will work on replicas?
Such possibility is very helpful in generating reports.
Now, LET command produces an error:

ERROR:  cannot execute LET in a read-only transaction

But if we say that variables are non-transactional ?

-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

On 08.03.2018 21:00, Pavel Stehule wrote:
> Hi
>
> 2018-02-07 7:34 GMT+01:00 Pavel Stehule <[email protected] 
> <mailto:[email protected]>>:
>
>     Hi
>
>     updated patch with your changes in documentation and pg_dump
>     (initial) support
>
>     Main issue of this patch is storage. We can reuse local buffers
>     used for temp tables. But it does allocation by 8KB and it creates
>     temp files for every object. That is too big overhead. Storing
>     just in session memory is too simple - then there should be lot of
>     new code used, when variable will be dropped.
>
>     I have ideas how to allow work with mix of scalar and composite
>     types - so it will be next step of this prototype.
>
>     Regards
>
>     Pavel
>
>
> new update - rebased, + some initial support for composite values on 
> right side and custom types, arrays are supported too.
>
> omega=# CREATE VARIABLE xx AS (a int, b numeric);
> CREATE VARIABLE
> omega=# LET xx = (10, 20)::xx;
> LET
> omega=# SELECT xx;
> +---------+
> |   xx    |
> +---------+
> | (10,20) |
> +---------+
> (1 row)
>
> omega=# SELECT xx.a + xx.b;
> +----------+
> | ?column? |
> +----------+
> |       30 |
> +----------+
> (1 row)
>
> omega=# \d xx
> schema variable "public.xx"
> +--------+---------+
> | Column |  Type   |
> +--------+---------+
> | a      | integer |
> | b      | numeric |
> +--------+---------+
>
>
> Regards
>
> Pavel
>
>



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: [HACKERS] proposal: schema variables
  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