Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kITsd-0004o1-S3 for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Sep 2020 09:37:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kITs6-0001s1-ED for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Sep 2020 09:37:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1kITs6-0001ru-5S for pgsql-hackers@lists.postgresql.org; Wed, 16 Sep 2020 09:37:02 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1kITs1-0003it-9N for pgsql-hackers@postgresql.org; Wed, 16 Sep 2020 09:37:01 +0000 Received: by mail-ed1-x544.google.com with SMTP id n22so5597576edt.4 for ; Wed, 16 Sep 2020 02:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=uKs8CRUaW3ZKhRriXd0zbE5Q25LgxVozUo5NsOHbkCo=; b=Qvw6SnQ5Q8mGn0j1sfrzdGffhMfbE3EcPwO3BDDu8KHzq9KZTVQ22zfMKEdYbmqjT5 ppINtSXw0vbX1EcviRr6seQHFp9CFG7dSUNJSqDLaT9Fai6DCzXWbqBIVA46JPbqsvk0 YrwgFR8yI+KfWX8o8ln8bzXZNKgURi5pnBc5RoKsk7j3UMg7s/UHDtGEaWWKtEgBqF6i a+vRpGWZdNYwu7fgXin0E8oGR9XCFpBGPJXibpU+bx1ClUt5XMBGI8STWCictJtdh5GM juWkPOtxV0+BXAT3KnvcEkWfdqE6ENVI0FfU/mxrVMIaeON8StCrT7MX7XM8ryGV0Ifk gHvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=uKs8CRUaW3ZKhRriXd0zbE5Q25LgxVozUo5NsOHbkCo=; b=XgbCPbdvf2ofEqnxjYHLiOdslqBLV4ujFvnSjbaFGGiQn0bFJcqswZ54JD/c2KN6zf sjIr8eKXVoPGdJeqfTHDO8Jp58s5NE0OUhwc10k20bWDAc83BFqi45xwANYdKS6pGSAC 9qMTjLjxGmxJR+5JlRvMY2eoWtDNb2QgXBK7+zAR2D4+SJ7Op5eh6eUYlsEvmpBKGfum MThyTh2m7eW6k96etKv/bag8PSs1uVhL5Rtx8NLTi7PkywBnO8aWRCUHO2Q7qWGT6fQt KFFZfWjn+4rq8v0lMMg47XM97/lTSgcmQ6GBOEly1MT0HvKTI4aIoX5mBY7LX+/ew61n xglg== X-Gm-Message-State: AOAM532Yy3b5AqAK583DjU+hwuS1+ccUZznLOH2gz80sopIU66I/MK94 +3ukOVG0/HdrnviyUB16xy4= X-Google-Smtp-Source: ABdhPJxNJJ37NiCZM/2Z/69Iu056apbbL2SJcSNQVAFMYKMlvnBsx1VI3IgHKYmDiHN1HNYysWgvsQ== X-Received: by 2002:aa7:c648:: with SMTP id z8mr26963045edr.239.1600249014642; Wed, 16 Sep 2020 02:36:54 -0700 (PDT) Received: from localhost (dslb-178-005-232-008.178.005.pools.vodafone-ip.de. [178.5.232.8]) by smtp.gmail.com with ESMTPSA id w1sm13160877eds.18.2020.09.16.02.36.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2020 02:36:53 -0700 (PDT) Date: Wed, 16 Sep 2020 11:37:03 +0200 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Pavel Stehule Cc: Justin Pryzby , Tom Lane , David Steele , Nikita Glukhov , Alvaro Herrera , David Fetter , Thomas Munro , Thomas Munro , Oleksandr Shulgin , Robert Haas , Andres Freund , Michael Paquier , Oleg Bartunov , Peter Eisentraut , PostgreSQL Hackers Subject: Re: [HACKERS] [PATCH] Generic type subscripting Message-ID: <20200916093703.rkyl66ggdhmw5pc6@localhost> References: <20200516122802.g4qbfxkr2zr7nlv2@localhost> <20200719191016.GW23581@telsasoft.com> <20200720160216.lav6vmyv6wbg7bfl@localhost> <20200728134308.qsstgwyyx3ngsfcw@localhost> <1808585.1596224122@sss.pgh.pa.us> <20200801143334.d7d3tsb7gaezx6vq@localhost> <20200805140422.fzwnvq7qr5vsgx3b@localhost> <20200909210435.GU18552@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > st 9. 9. 2020 v 23:04 Justin Pryzby wrote: > > This seems to already hit a merge conflict (8febfd185). > Would you re-rebase ? Thanks. Sure, will post a rebased version soon. > On Tue, Sep 15, 2020 at 08:42:40PM +0200, Pavel Stehule wrote: > > Maybe I found a another issue. > > create table foo(a jsonb); > > postgres=# select * from foo; > ┌───────────────────────────────────────────────────────────────────┐ > │ a │ > ╞═══════════════════════════════════════════════════════════════════╡ > │ [0, null, null, null, null, null, null, null, null, null, "ahoj"] │ > └───────────────────────────────────────────────────────────────────┘ > (1 row) > > It is working like I expect > > but > > postgres=# truncate foo; > TRUNCATE TABLE > postgres=# insert into foo values('[]'); > INSERT 0 1 > postgres=# update foo set a[10] = 'ahoj'; > UPDATE 1 > postgres=# select * from foo; > ┌──────────┐ > │ a │ > ╞══════════╡ > │ ["ahoj"] │ > └──────────┘ > (1 row) Thanks for looking at the last patch, I appreciate! The situation you've mention is an interesting edge case. If I understand correctly, the first example is the result of some operations leading to filling gaps between 0 and "ahoj". In the second case there is no such gap that's why nothing was "filled in", although one could expect presence of a "start position" and fill with nulls everything from it to the new element, is that what you mean?