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 1f8TTm-00081F-CN for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Apr 2018 16:29:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8TTl-0005aw-7i for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Apr 2018 16:29:13 +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 1f8TTl-0005am-0P for pgsql-hackers@lists.postgresql.org; Tue, 17 Apr 2018 16:29:13 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f8TTY-0000bQ-Jb for pgsql-hackers@postgresql.org; Tue, 17 Apr 2018 16:29:12 +0000 Received: by mail-wr0-x244.google.com with SMTP id v24so20179184wra.8 for ; Tue, 17 Apr 2018 09:29:00 -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=HGDbq5P7SI/CbaKuedbOND8qZmtbsrGVlITfgMxf2Ow=; b=EgWowf8tiXPJckSDHT7luPixPumPpDgx3jfVcgf+UdtmtGZs5GpKLpNkVEWcqfhxA6 fZ/j66JruKkL3J8K+AoA3itwSNrket0ZVaAoiLFmxDWUrzko4Mrr+H52/tYYjRc2FKbZ 8pkKCiNZ9EcFM3j0NyZPrZjaI1I7rPTnqWZgldgPQVuvzeFEQvJcVSeNar/g3K5opeor zg193k+xEjeUAUmslXshH3VuecGmCP8zfQ6NAY8Z+AS6qehGQgaeQ30dpms409SsvowD utStyHI/mP+bG7enwuIhbp/bXxtHlIfpiIZ/S7/kKq0xxSzdQMzJjVUJHnqnAa6hrfOd ojEQ== 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=HGDbq5P7SI/CbaKuedbOND8qZmtbsrGVlITfgMxf2Ow=; b=DEFOMoj195YzNOIBB7GixPzt0ikbyolyvFw6Cpv3SSabxnimkZo74j0HoCGsLcdq4T 6+jNEUO8TgYAe8duFxXe4dp2r0DhiCqfyhMKADMZ+Ma3yGkgdNb9NyyB7oDGsIHpUB4K OldybfQFI7Zf1TpgvO7zyKoH7dKsisOLcdWVw65OfXJhCEY7ekO4hpzl2eeHQH3L5rtw be3CbMPrGVhXkwDEnmV+L0rds9/p5tRmKH7wJzs8kKdYclbmMlCSqwTOHdsKnwBE/Vtq QoqNLyIASitiuTNHFtn5zrcHZHH6DhzuzQ0/+bNnN84NChNF7wqbzcteUNeV3+Vesxn2 sdxQ== X-Gm-Message-State: ALQs6tCG9GMT9v7u+Uk2efoUTsT2wnaoLJU77WTPRwg9p3UwX7h+SCTP CobsQvTH6sQ0RZpOyrdwibTkOkQJQ3L+WwuPL9E= X-Google-Smtp-Source: AIpwx4/wuId/1/GHQnsbOG/WdDe+BH/4+8XDNS3gfv/1fMYIB+0kmjSXvMyjDac/Yx2s4lfUCCzEIugi7fSLuQKw6QA= X-Received: by 10.223.149.68 with SMTP id 62mr2048581wrs.201.1523982539509; Tue, 17 Apr 2018 09:28:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.166.197 with HTTP; Tue, 17 Apr 2018 09:28:19 -0700 (PDT) In-Reply-To: <20180417141410.GA7917@zakirov.localdomain> References: <20180417141410.GA7917@zakirov.localdomain> From: Pavel Stehule Date: Tue, 17 Apr 2018 18:28:19 +0200 Message-ID: Subject: Re: [HACKERS] proposal: schema variables To: Arthur Zakirov Cc: PostgreSQL Hackers Content-Type: multipart/alternative; boundary="94eb2c0df0ece9558b056a0dd5b9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --94eb2c0df0ece9558b056a0dd5b9 Content-Type: text/plain; charset="UTF-8" Hi 2018-04-17 16:14 GMT+02:00 Arthur Zakirov : > Hello Pavel, > > On Thu, Oct 26, 2017 at 09:21:24AM +0200, Pavel Stehule wrote: > > I hope so this proposal is good enough and simple. > > > > Comments, notes? > > As I understood variables are stored in pg_class table. Did you consider > storing variables in a special catalog table? It can be named as > pg_variable. > > pg_variable table requires more code of course, but it would fix the > issues: > - pg_class has a lot attributes which are not related with variables, > and I think variables don't need many of them > - in a future variables might want to have some additional attributes > which are not needed for relations, you can easily add them to > pg_variable > > What do you think? > I though about it, and I am inclined to prefer pg_class instead separate tables. 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. There are two objective arguments for using pg_class: 1. unique name in schema - it reduces risk of collisions 2. sharing lot of code So in this case I don't see well benefits of separate table. Regards Pavel > > -- > Arthur Zakirov > Postgres Professional: http://www.postgrespro.com > Russian Postgres Company > --94eb2c0df0ece9558b056a0dd5b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

2018-04-17 16:14 GMT+02:00 Arthur Zakirov <= a.zakirov@pos= tgrespro.ru>:
Hello Pavel,<= br>
On Thu, Oct 26, 2017 at 09:21:24AM +0200, Pavel Stehule wrote:
> I hope so this proposal is good enough and sim= ple.
>
> Comments, notes?

As I understood variables are stored in pg_class table. Did you cons= ider
storing variables in a special catalog table? It can be named as
pg_variable.

pg_variable table requires more code of course, but it would fix the issues= :
- pg_class has a lot attributes which are not related with variables,
=C2=A0 and I think variables don't need many of them
- in a future variables might want to have some additional attributes
=C2=A0 which are not needed for relations, you can easily add them to
=C2=A0 pg_variable

What do you think?

I though about it, a= nd I am inclined to prefer pg_class instead separate tables.

=
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. Seman= tically, I see variables in family of sequences, tables, indexes, views. No= w, it shares code, and I hope in next steps more code can be shared - const= raints, triggers.

There are two objective arguments for u= sing pg_class:

1. unique name in schema - it reduces risk= of collisions
2. sharing lot of code

So i= n this case I don't see well benefits of separate table.

=
Regards

Pavel

=C2=A0

--
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

--94eb2c0df0ece9558b056a0dd5b9--