Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duDmy-0000Ji-Gs for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Sep 2017 08:21:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1duDmy-0005v2-3c for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Sep 2017 08:21:52 +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.84_2) (envelope-from ) id 1duDmx-0005us-8A for pgsql-hackers@postgresql.org; Tue, 19 Sep 2017 08:21:51 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duDmt-000111-O8 for pgsql-hackers@postgresql.org; Tue, 19 Sep 2017 08:21:50 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 6D9EE21C1D22; Tue, 19 Sep 2017 11:21:44 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from zakirov.localdomain (unknown [192.168.27.1]) (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 3A18221C1CC3; Tue, 19 Sep 2017 11:21:44 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1505809304; bh=n0nUJxG9aP4kBVlQdLwV86N7DNsT4gsM/Ew/VES4xqQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=UOzeVgnX6c0Evb4yg29imToaeBodJMwHYsl7Zx9XbT38LZonLw1EsN6Wg8hD75SDc 89PD/pDM7k1Qx8BuK7qAafD33+HCWjqAH1ENT3C7GJJrWGP7tehu/r0dGTjq3DXCcw tAxzXLpzslPigDv8xdqUmepxQHC1lvt18NM1H7RA= Date: Tue, 19 Sep 2017 11:21:43 +0300 From: Arthur Zakirov To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Tom Lane , David Steele , Peter Eisentraut , PostgreSQL-development Subject: Re: [PATCH] Generic type subscripting Message-ID: <20170919082141.GA2647@zakirov.localdomain> References: <5907.1505166328@sss.pgh.pa.us> <20170916220454.GA15505@arthur.localdomain> <20170917213427.GA4430@arthur.localdomain> <20170918093943.GA3473@zakirov.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.0 (2017-09-02) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Mon, Sep 18, 2017 at 12:25:04PM +0200, Dmitry Dolgov wrote: > > I think it would be good to add new catalog table. It may be named as > pg_type_sbs or pg_subscripting (second is better I think). > > This table may have the fields: > > - oid > > - sbstype > > - sbsinit > > - sbsfetch > > - sbsassign > > What is `sbstype`? 'sbstype' is oid of type from pg_type for which subscripting is created. I.e. pg_type may not have the 'typsubsparse' field. > > And command 'CREATE SUBSCRIPTING' should add an entry to the > pg_subscripting table. It also adds entries to the pg_depend table: > dependency between pg_type and pg_subscripting, dependency between pg_type > and pg_proc. > > 'DROP SUBSCRIPTING' should drop this entries, it should not drop init > function. > > Why we should keep those subscripting functions? From my understanding > they're > totally internal and useless without subscripting context. > Other similar commands do not drop related functions. For example 'DROP CAST' do not drop a function used to perform a cast. > It also adds entries to the pg_depend table: dependency between pg_type and pg_subscripting, dependency between pg_type and pg_proc. Here was a typo from me. Last entry is dependency between pg_subscripting and pg_proc. -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers