public inbox for pgsql-performance@postgresql.org
help / color / mirror / Atom feedFrom: Pavel Stehule <pavel.stehule@gmail.com>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Philippe BEAUDOIN <phb07@apra.asso.fr>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: proposal: schema variables
Date: Sun, 26 Jan 2020 18:26:16 +0100
Message-ID: <CAFj8pRDxHCt9_fDQ8cu07jB4KzyU1qmzgH9uA1XsPdqvZN-w6A@mail.gmail.com> (raw)
In-Reply-To: <20200121234141.se4v2hygsiy3lffx@development>
References: <CAFj8pRDY+m9OOxfO10R7J0PAkCCauM-TweaTrdsrsLGMb1VbEQ@mail.gmail.com>
<CAFj8pRAcb+PLKJJOGn7POtcTuH8DaKqZNid-7UvB9_BtgshHEQ@mail.gmail.com>
<157772317031.1198.14690129684698137065.pgcf@coridan.postgresql.org>
<CAFj8pRA+SYbegM6f5OTamwhMdsVXB22mbmkscaErrhYge8ji3A@mail.gmail.com>
<CAFj8pRCAGXK9Wd8FGboFkFyUTWwh0qJUKW0muVAMkAUq6feCdA@mail.gmail.com>
<20200121234141.se4v2hygsiy3lffx@development>
>
>
> 12) I find it rather suspicious that we make decisions in utility.c
> solely based on commandType (whether it's CMD_UTILITY or not). IMO
> it's pretty strange/ugly that T_LetStmt can be both CMD_UTILITY and
> CMD_PLAN_UTILITY:
>
> case T_LetStmt:
> {
> if (pstmt->commandType == CMD_UTILITY)
> doLetStmtReset(pstmt);
> else
> {
> Assert(pstmt->commandType == CMD_PLAN_UTILITY);
> doLetStmtEval(pstmt, params, queryEnv, queryString);
> }
>
> if (completionTag)
> strcpy(completionTag, "LET");
> }
> break;
>
>
>
It looks strange, but it has sense, because the LET stmt supports reset to
default value.
I can write
1. LET var = DEFAULT;
2. LET var = (query);
In first case I have not any query, that I can assign, and in this case the
LET statement is really only UTILITY.
I did comment there
Regards
Pavel
>
>
> regards
>
> --
> Tomas Vondra http://www.2ndQuadrant.com
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
Attachments:
[application/gzip] 0001-schema-variables-20200126.patch.gz (64.2K, 3-0001-schema-variables-20200126.patch.gz)
download
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: pgsql-performance@postgresql.org
Cc: pavel.stehule@gmail.com, tomas.vondra@2ndquadrant.com, phb07@apra.asso.fr, pgsql-hackers@lists.postgresql.org
Subject: Re: proposal: schema variables
In-Reply-To: <CAFj8pRDxHCt9_fDQ8cu07jB4KzyU1qmzgH9uA1XsPdqvZN-w6A@mail.gmail.com>
* 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