Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a4qnA-000237-N5 for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Dec 2015 13:52:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a4qnA-0002eS-0N for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Dec 2015 13:52:56 +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.84) (envelope-from ) id 1a4qn6-0002bB-Me for pgsql-hackers@postgresql.org; Fri, 04 Dec 2015 13:52:52 +0000 Received: from hook.sigaev.ru ([93.180.27.50]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4qn3-0006X9-JZ for pgsql-hackers@postgresql.org; Fri, 04 Dec 2015 13:52:52 +0000 Received: from xor.sai.msu.ru (newmail.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: teodor) by hook.sigaev.ru (Postfix) with ESMTPSA id 5C9EBB1918A; Fri, 4 Dec 2015 16:52:48 +0300 (MSK) Subject: Re: Some questions about the array. To: YUriy Zhuravlev , pgsql-hackers@postgresql.org References: <2987745.PueTkqGxbO@dinodell> <565D92F7.5000505@sigaev.ru> <1899635.M2QZgB1EhQ@dinodell> <1538864.xaPm21N10Q@dinodell> From: Teodor Sigaev Message-ID: <56619AB0.2070802@sigaev.ru> Date: Fri, 4 Dec 2015 16:52:48 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: <1538864.xaPm21N10Q@dinodell> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) 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 Some inconsistency (if we believe that omitted lower bound is equal to 1): regression=# insert into arrtest_s values ('[-1:9]={3,1,4,1,5,9,5,6,7,8,9}'::int[], null); INSERT 0 1 regression=# UPDATE arrtest_s SET a[:2] = '{23, 24, 25}'; ERROR: source array too small regression=# UPDATE arrtest_s SET a[1:2] = '{23, 24, 25}'; UPDATE 1 Seems, omitting boundaries in insert/update isn't a good idea. I suggest to allow omitting only in select subscripting. YUriy Zhuravlev wrote: > On Tuesday 01 December 2015 15:43:47 you wrote: >> On Tuesday 01 December 2015 15:30:47 Teodor Sigaev wrote: >>> As I understand, update should fail with any array, so, first update >>> should >>> fail too. Am I right? >> >> You right. Done. New patch in attach. > > Found error when omitted lower bound in INSERT like this: > INSERT INTO arrtest_s (a[:2], b[1:2]) VALUES ('{1,2,3,4,5}', '{7,8,9}'); > > I fix it in new patch. Lower bound for new array is 1 by default. > > Thanks. > > > > -- Teodor Sigaev E-mail: teodor@sigaev.ru WWW: http://www.sigaev.ru/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers