Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eE3Ss-0005SL-El for pgsql-general@arkaria.postgresql.org; Mon, 13 Nov 2017 01:23:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eE3Sq-0002S3-Jg for pgsql-general@arkaria.postgresql.org; Mon, 13 Nov 2017 01:23:04 +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 1eE3Sp-0002R0-5t for pgsql-general@postgresql.org; Mon, 13 Nov 2017 01:23:03 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eE3Sm-0007YB-2C for pgsql-general@postgresql.org; Mon, 13 Nov 2017 01:23:01 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 5333920B1C for ; Sun, 12 Nov 2017 20:22:58 -0500 (EST) Received: from web3 ([10.202.2.213]) by compute2.internal (MEProxy); Sun, 12 Nov 2017 20:22:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antarkt.is; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=eCSSOw5qhNb4CT89dTc42WN8Y5zaZScRqzHfNLAn1ZI=; b=gMQ7u B2EGxnzgAaFMDx3wGau70V/tjgaioP34+3qqv1fihzu4HLoNIQHsr5AL3Pxmcwnt kGBeZaW23BIzkrJ814SzaMFLPOSnksDguE7/Rm9DYQvu2pPJ3H9CllhR41GuhJRS uTPCddqm983eeLMjqeTAeNR9GVKm/W/94JGsBQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=eCSSOw5qhNb4CT89dTc42WN8Y5zaZ ScRqzHfNLAn1ZI=; b=ZJbukiQYKZmy3F7kAkKnK6hR7AmlYxg4AQZslBwI1xCTz TjjjGsO7YcPoTHATN6Nx6gP8gaqb5yUFP+cQTgt3ra9zejZskpq4OWE0ddV6TPMM HJGFNtx4GGPEq41mE0Uv51lZfVBNC3DldBWcssSyJoVEq1KIPYYrodUt5TtiiNZZ Ua41FdHTRnlX1nZpzsnPiDedzjKpNA4CECMRwCuKQCkuAT6j1FcRBoM6fnRYn1uG /CI9fGWMQOXr4rXPO6NOeGAIF7gWS9heiDRA4hjOq7T90i00sMvSShx+jwWWjAtS JAxrb41KFJCZzHODSbwQPNmJLEm7fIalKpG1z0/LQ== X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 29BEE9EBAF; Sun, 12 Nov 2017 20:22:58 -0500 (EST) Message-Id: <1510536178.2747282.1170204616.4A024CB2@webmail.messagingengine.com> From: Aron Widforss To: pgsql-general@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-f89283c9 Date: Mon, 13 Nov 2017 02:22:58 +0100 Subject: Multiple unnests in query List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Good night, Is this first query expected behavior? If so, what is the rationale? I would have expected nine rows returned (as in my second example). Regards, Aron Widforss SELECT unnest(ARRAY[1, 1, 2]) AS unnested1, unnest(ARRAY[3, 3, 4]) AS unnested2 ; unnested1 | unnested2 -----------+----------- 1 | 3 1 | 3 2 | 4 (3 rows) SELECT unnest(ARRAY[1, 1, 2]) AS unnested1, sec FROM (SELECT 3 AS sec UNION ALL SELECT 3 AS sec UNION ALL SELECT 4 AS sec) test ; unnested1 | sec -----------+----- 1 | 3 1 | 3 2 | 3 1 | 3 1 | 3 2 | 3 1 | 4 1 | 4 2 | 4 (9 rows) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general