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 1f8lOn-0007TM-Ib for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Apr 2018 11:37:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8lOm-0004jt-Ev for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Apr 2018 11:37:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8lOm-0004jj-4G for pgsql-hackers@lists.postgresql.org; Wed, 18 Apr 2018 11:37:16 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8lOj-0006yk-FN for pgsql-hackers@postgresql.org; Wed, 18 Apr 2018 11:37:14 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 9B77D21C1F5C; Wed, 18 Apr 2018 14:37:12 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from zakirov.localdomain (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 6F19421C1E2D; Wed, 18 Apr 2018 14:37:12 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1524051432; bh=xafogJ3kIrPZu43xkKUUuRirdvTLalGKBqTKlVwOvig=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Q3ozpBvP/zmuyB0TdSSA7C5sgj90pblT2hhm5u0cByUIkj3wb5LE5JYiwm7A1zpz4 q/GbxMGUef+U6WrS4tqqSG8hEp+Xl1Mgvuu8mnRSIThMAZxPIXcVGbMJN949kowC90 /aQ9F9A7F7sC8ByxnjlcyyL404kqYHtoE2B6wqhk= Date: Wed, 18 Apr 2018 14:37:11 +0300 From: Arthur Zakirov To: Pavel Stehule Cc: PostgreSQL Hackers Subject: Re: [HACKERS] proposal: schema variables Message-ID: <20180418113710.GA8232@zakirov.localdomain> References: <20180417141410.GA7917@zakirov.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Apr 17, 2018 at 06:28:19PM +0200, Pavel Stehule wrote: > 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. Understood. I haven't strong opinion here though. But I thought that pg_class approach may limit extensibility of variables. BTW: - there is unitialized variable 'j' in pg_dump.c:15422 - in tab-complete.c:1268 initialization needs extra NULL before &Query_for_list_of_variables Also I think makeRangeVarForTargetOfSchemaVariable() has non friendly argument names 'field1', 'field2', 'field2'. -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company