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 1opYCm-0001w4-9y for pgsql-sql@arkaria.postgresql.org; Mon, 31 Oct 2022 17:04:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1opYCl-0003US-3E for pgsql-sql@arkaria.postgresql.org; Mon, 31 Oct 2022 17:04:07 +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 ) id 1opYCk-0003UJ-P0 for pgsql-sql@lists.postgresql.org; Mon, 31 Oct 2022 17:04:06 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1opYCi-0002s9-Lt for pgsql-sql@lists.postgresql.org; Mon, 31 Oct 2022 17:04:06 +0000 Received: by mail-pl1-x633.google.com with SMTP id v17so8276470plo.1 for ; Mon, 31 Oct 2022 10:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=8+xnACIV70yOOLEvToE0ivy6/XYs6nrrTmm5epmAfUc=; b=CqkahOZD8WGuSISaG/SWu5V5QecOe6Y3JvTvmWYLjsgNOO14Ca4BvaW1IDwfKouq8k ypxoyoAe3EHD7O5I2T5j2vbnf+lw/UPzVGOSAvDMxWL5ImPTO15bkAyLmJ9uFrkmpUzd 2ocn8HJDSVVCxx03dSpQyXFkUI8H4Fy6yiSAHOJqtxxPnKLq+x/Xu35xPgg2Sy3DsRzG e56eC1q/+YG2wZdIf4fEaKmI8essmlBrwV7cDfjvUEYn0FNwS+jLEOWCj+QI/Fl2gxgj 95tv5P9DEUaX1aRVPg6IR0KcCqkzvdXd+aZSRfhjD3dyNmqbI14fbGyMpopdbiqhHnsj aWvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8+xnACIV70yOOLEvToE0ivy6/XYs6nrrTmm5epmAfUc=; b=kKdd3TGm9YbynKES8Q4ZG1rnCwHdHLiZXcDhCYL9RPzfI3eMfM8VsOgxM6TasoRgR1 g3mgpARCSD9SbVkU0AFPiHgggCl14TMJjWu3b+GXRqcXWlSrVELlM3kCLxXngPUwLsgf wmY+q7EgP4DL47FuMPkLoWX5bbnmbv0tmd52CzxqbTcDG905Tqu3p18xZoWvdZMBxHU2 pdRK/KSNte2eqshRJkzIkAfJ9InmGtcwNBIrwmAhMIshOWSUAgdVdn7qOIkjCbbO+XIK FLyVr93PF6xAOsbS7mMgxsW3cywelTliAIYMnHhz7pCACYT5VV4HSkD/2lgHkrLy8mfE 1wkA== X-Gm-Message-State: ACrzQf1VZSYYm3zc7budTSQ6TAlYlXGUUZw8ZfWVQX9Oq0Fx0Z+QXb4F 3KWWSgrRILOFotCVyNaAHk70TyhQZ8E= X-Google-Smtp-Source: AMsMyM68WvV6ILYj8cQ8xREdejlzTJGfHAT0aOnm+9yfwntYuVb98KTKXJ88sWjXK8NcqIl0ujXYOA== X-Received: by 2002:a17:902:a611:b0:178:6b71:2ee5 with SMTP id u17-20020a170902a61100b001786b712ee5mr15003896plq.53.1667235841945; Mon, 31 Oct 2022 10:04:01 -0700 (PDT) Received: from [10.128.56.136] ([155.98.131.0]) by smtp.gmail.com with ESMTPSA id z12-20020aa79f8c000000b0056d98e31439sm1532985pfr.140.2022.10.31.10.04.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Oct 2022 10:04:01 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------DprjJpI9m01laX9ZzGa8g4R8" Message-ID: <5fb866d1-8d2f-5118-18e2-9bbf227cbf1a@gmail.com> Date: Mon, 31 Oct 2022 11:04:00 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-CA To: pgsql-sql From: Rob Sargent Subject: access sub elements using any() List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------DprjJpI9m01laX9ZzGa8g4R8 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Given an array of arrays ( e.g. v = {{1,'a'},{2,'b'},{3,'c'},{2,'d'}} ) is it possible, in plain sql, to access the first element of the listed arrays using the IN function?  Say I wanted just those with 2 as first element.  "where 2 = any(v[1])" does not work and not sure it's supported.   And I cannot craft a lhs to fussy-match each of the elements in v.  Can this be done? --------------DprjJpI9m01laX9ZzGa8g4R8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Given an array of arrays ( e.g. v = {{1,'a'},{2,'b'},{3,'c'},{2,'d'}} ) is it possible, in plain sql, to access the first element of the listed arrays using the IN function?  Say I wanted just those with 2 as first element.  "where 2 = any(v[1])" does not work and not sure it's supported.   And I cannot craft a lhs to fussy-match each of the elements in v.  Can this be done?
--------------DprjJpI9m01laX9ZzGa8g4R8--