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 1kMpa0-0003fV-F5 for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Sep 2020 09:36:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kMpZz-0003nY-Db for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Sep 2020 09:36:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1kMpZz-0003nR-6d for pgsql-hackers@lists.postgresql.org; Mon, 28 Sep 2020 09:36:19 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1kMpZw-0003px-RK for pgsql-hackers@postgresql.org; Mon, 28 Sep 2020 09:36:18 +0000 Received: by mail-wr1-x444.google.com with SMTP id s12so459812wrw.11 for ; Mon, 28 Sep 2020 02:36:16 -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:in-reply-to; bh=yGfRlK6jPJ9yhIm6TtUC/5vyPZ+N1uoIwqlmszdj57Q=; b=C/1V65TWkuVKl1Yf+vmEIjks3u0jUAG6iVy9Nor6ileKaNd3etF6DcnP0bm2w955gG 3dxHeq/Sr0g2ufp2f3i3EHgkedahrDX2020AhuMYFv9iQzSCQ4wWbmpdgF0vfTamd1DC iS7IwbZk1n3oB7n24Gy3ni82l/Om4FN4F+jy1xgkg116prcI7QbPC0L0WIVTu/+h1qof 1ONZWdYRtHed6wSbNA7IiLnBDJSuPHxBiOsaMxKhlTWPkDX7srSdMIcSQjR270Y1DDKW 8NZt6oI2s7ZFgGMKtU9gsUprS5EiZon3mnVLNRMWETvfJ6NlevFoLFjHdJ5SfCcxxoRF Kr8w== 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:in-reply-to; bh=yGfRlK6jPJ9yhIm6TtUC/5vyPZ+N1uoIwqlmszdj57Q=; b=aPGPCJ+rQtuwYwD8UDTwP8LnU3O8HBs5dGgmZ+oViKxMukkWhAl92+1GACtnBkzhJ7 HKbVqzDrh5hvQr201L1jylkQfuSgu6RrwmpzsxhQxnVF6mG96xXsjBheeU5Pv+mMVWHU gnrjA0cm3QGoOUBsg9eZ4wMes8OtLJW1RSWgoqrBZ7ZFYxphFvG6O1x3KKxhK6ZbTuFI DUQwxUggzGAWCYaUlMsL0z5p04KEKVhoZfv7CQW5hFVOOPTMFkfrxHK08sEXUZ2wOxAh 2ncPiLKQT0s6TS2SNVsvdWfZsLc3zq8bkjCm9Pnjj3EIzzJ5wo+jBvcP5YQXcGNVoe6o 5vQw== X-Gm-Message-State: AOAM533q2gREu3EfQ796zKvVIX+/IfLx9o71swsmPaBJsg2nxPnz8twz eSf2ug0+isJMQm0l15RCXOE= X-Google-Smtp-Source: ABdhPJzXBNwQolLNUJ3DAS7lpS7YQL6mQFLLGI0q9+YZ8zLRKopjX8xUQdeJP9fGPkiSlNd81x96sw== X-Received: by 2002:a5d:444e:: with SMTP id x14mr622702wrr.235.1601285776255; Mon, 28 Sep 2020 02:36:16 -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 h16sm681676wre.87.2020.09.28.02.36.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2020 02:36:15 -0700 (PDT) Date: Mon, 28 Sep 2020 11:36:31 +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: <20200928093631.obnmgllx3ihhjvsd@localhost> References: <20200916093703.rkyl66ggdhmw5pc6@localhost> <20200917105849.vgqhutrooatdxwzq@localhost> <20200917135627.7koag6rnhshgjlai@localhost> <20200918110204.77yu4ioqlhhfhcya@localhost> <20200920154652.etzmrphoe3hiod7t@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Fri, Sep 25, 2020 at 06:43:38PM +0200, Pavel Stehule wrote: > > I checked this set of patches and it looks well. > > I have only one minor comment. I understand the error message, but I am not > sure if without deeper knowledge I can understand. > > +update test_jsonb_subscript set test_json[-8] = 1; > +ERROR: path element at position 1 is out of range: -8 > > Maybe 'value of subscript "-8" is out of range'. Current error message is > fully correct - but people probably have to think "what is a path element > at position 1?" It doesn't look intuitive. > > Do you have some idea? Interesting question. I've borrowed this error message format from other parts of setPath function where it appears couple of times and unfortunately can't suggest anything better. In case it this patch will get lucky enough to attract someone else, maybe we can leave it to a committer, what do you think? > My comment is minor, and I mark this patch with pleasure as ready for > committer. > > patching and compiling - without problems > implemented functionality - I like it > Building doc - without problems > make check-world - passed Thanks!