Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9a6b-0003Ra-VB for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Apr 2018 17:45:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f9a6Z-00033M-RT for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Apr 2018 17:45:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9a6Z-000333-I4 for pgsql-hackers@lists.postgresql.org; Fri, 20 Apr 2018 17:45:51 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f9a6W-0006UE-5O for pgsql-hackers@postgresql.org; Fri, 20 Apr 2018 17:45:50 +0000 Received: by mail-wr0-x241.google.com with SMTP id v15-v6so6922818wrm.10 for ; Fri, 20 Apr 2018 10:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KX9XlTtqBMUMGet7BTgP8EUgkm2zDrtUcQxIAzbVHbs=; b=U57dYF/2xt/smVp9h2wLu8YuDHK4Fdi1PxqYYT7po5lGBFAhQj8SMTc0LEBwqr8UJQ lawaTInnWFN6/zEQXmSrS+q9VRlYGJZTlDl9e0WIVY506mjDAEF+eZkdgugghxLqT0X7 SW7IaVPUmZkrDWvFnWj8VFX01q61FmRMtXZPlrjeHzWrQzRULvmQTJ+JmLWYfhBTRnx+ cEbO+fE1z8vFEK61jLsDN4ZMFmDRXjQrYXmlPskSt9ulXVjKnxz6yRwgah58EVeE1OJ7 7HBruJLYHiek51EHJIiXXhjtA0LrGuYE3KpZXQjIHE/Kn9xUvX8qUmm1M6p5LVyTUINR 30tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KX9XlTtqBMUMGet7BTgP8EUgkm2zDrtUcQxIAzbVHbs=; b=K4O6AfuobBsxBkkiH+A2ZiBHaLx3u5NCV7Ct4J1LbLWjlSh17DgK8Y3tOvZUe+BtEi gQD4sfLjTrN0juo8gUoNK5rk//MXlaykyhCekK6BZjSzEUrh56tkiSpEY7Ho4MYMaRq3 4ope8AfyN0sxJrOROu5ONBVo7S3PUMqTnBtqMpf77vcXfrSC3zDy353G2j/RkaOaarDz 3cJnt188bOpJBstIMyl/pfIik+pw2Kn4rUQ3WYa/iuxF6LckUZlpyy0b7rGmw57RuWRA XRlr1EB660GFh1NMYHGpIZlQJYri0F8D4EbE6a0HKWVYu0z+/tCtj7vtIqlOOPrvJpds lFLw== X-Gm-Message-State: ALQs6tBxDgfSA/glSdXi8EvHee9yaUy+uhehPIVmtBA72QdR/BHIyhiw JNyJ8wQnqsAEVmBVZFVyRSDvTKfomVpSW/mPEsI= X-Google-Smtp-Source: AIpwx48FMdUBK/p7lgnWm6XG7IlxfaSOex1zs56XMuSaJ3JiRU/0AfGAC11kNYFk69Qx1kjD74l7kc8bGKNYuba31EA= X-Received: by 10.28.62.139 with SMTP id l133mr2476068wma.108.1524246347169; Fri, 20 Apr 2018 10:45:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.166.197 with HTTP; Fri, 20 Apr 2018 10:45:06 -0700 (PDT) In-Reply-To: References: <20180417141410.GA7917@zakirov.localdomain> From: Pavel Stehule Date: Fri, 20 Apr 2018 19:45:06 +0200 Message-ID: Subject: Re: [HACKERS] proposal: schema variables To: Robert Haas Cc: Arthur Zakirov , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="001a1148edac12c463056a4b42fd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --001a1148edac12c463056a4b42fd Content-Type: text/plain; charset="UTF-8" 2018-04-20 17:32 GMT+02:00 Robert Haas : > On Tue, Apr 17, 2018 at 12:28 PM, Pavel Stehule > wrote: > > It true, so there are lot of "unused" attributes for this purpose, but > there > > is lot of shared attributes, and lot of shared code. Semantically, I see > > variables in family of sequences, tables, indexes, views. Now, it shares > > code, and I hope in next steps more code can be shared - constraints, > > triggers. > > I dunno, it seems awfully different to me. There's only one "column", > right? What code is really shared here? Are constraints and triggers > even desirable feature for variables? What would be the use case? > The schema variable can hold composite value. The patch allows to use any composite type or adhoc composite values DECLARE x AS compositetype; DECLARE x AS (a int, b int, c int); Constraints are clear, no. Triggers are strange maybe, but why not - it can be used like enhanced constraints, can be used for some value calculations, .. > I think stuffing this into pg_class is pretty strange. > It will be if variable is just scalar value without any possibilities. But then there is only low benefit The access rights implementation is shared with other from pg_class too. Regards Pavel > > -- > Robert Haas > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > --001a1148edac12c463056a4b42fd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


2018-04-20 17:32 GMT+02:00 Robert Haas <robertmhaas@gmail.com&= gt;:
On Tue, Apr = 17, 2018 at 12:28 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> It true, so there are lot of "unused" attributes for this pu= rpose, but there
> is lot of shared attributes, and lot of shared code. Semantically, I s= ee
> variables in family of sequences, tables, indexes, views. Now, it shar= es
> code, and I hope in next steps more code can be shared - constraints,<= br> > triggers.

I dunno, it seems awfully different to me.=C2=A0 There's only on= e "column",
right?=C2=A0 What code is really shared here?=C2=A0 Are constraints and tri= ggers
even desirable feature for variables?=C2=A0 What would be the use case?
=

The schema variable can hold composite val= ue. The patch allows to use any composite type or adhoc composite values
DECLARE x AS compositetype;
DECLARE x AS (a i= nt, b int, c int);

Constraints are clear, no.=C2=A0
<= br>
Triggers are strange maybe, but why not - it can be used like= enhanced constraints, can be used for some value calculations, ..

<= /div>

I think stuffing this into pg_class is pretty strange.

It will be if variable is just scalar value without any pos= sibilities. But then there is only low benefit

The access= rights implementation is shared with other from pg_class too.

Regards

Pavel
=C2=A0

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--001a1148edac12c463056a4b42fd--