Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a2JwA-0008RX-18 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Nov 2015 14:23:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a2Jw9-00007t-J7 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Nov 2015 14:23:45 +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 1a2Jw7-000067-AN for pgsql-hackers@postgresql.org; Fri, 27 Nov 2015 14:23:43 +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 1a2Jw0-0002MM-7y for pgsql-hackers@postgresql.org; Fri, 27 Nov 2015 14:23:42 +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 C9AE2B1918A; Fri, 27 Nov 2015 17:23:35 +0300 (MSK) Message-ID: <56586767.6040205@sigaev.ru> Date: Fri, 27 Nov 2015 17:23:35 +0300 From: Teodor Sigaev User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1 MIME-Version: 1.0 To: YUriy Zhuravlev , pgsql-hackers@postgresql.org Subject: Re: Some questions about the array. References: <2987745.PueTkqGxbO@dinodell> <1885247.qWD6L4eZuE@dinodell> In-Reply-To: <1885247.qWD6L4eZuE@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 comments about patch 1 Documentation isn't very informative Outputs of SELECT schedule[:][:] FROM sal_emp WHERE name = 'Bill' and SELECT schedule[:2][1:] FROM sal_emp WHERE name = 'Bill'; are the same. Suppose, it's better to have differs ones. 2 # create table xxx (a int[]); # update xxx set a[2:] = '{1,2}'; UPDATE 0 # update xxx set a[2:] = '{1,2}'; ERROR: cannot determine upper index for empty array # update xxx set a[:2] = '{1,2}'; ERROR: invalid input syntax for integer: "{1,2}" # update xxx set a[:] = '{1,2}'; ERROR: invalid input syntax for integer: "{1,2}" Seems, error messages are too inconsistent. If you forbid omitting bound in assigment then if all cases error message should be the same or close. YUriy Zhuravlev wrote: > Hello again. > I attached simple patch for omitted boundaries in the slice. > This will simplify the writing of SQL. Instead: > select arr[2:array_upper(arr, 1)]; > you can write: > select arr[2:]; > > simple and elegant. > Omitted boundaries is prohibited in UPDATE. > > 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