Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDEEj-0005hT-UK for pgsql-general@arkaria.postgresql.org; Wed, 25 Sep 2019 20:50:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDEEi-00050i-Q9 for pgsql-general@arkaria.postgresql.org; Wed, 25 Sep 2019 20:50:08 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDEEi-00050b-F6 for pgsql-general@lists.postgresql.org; Wed, 25 Sep 2019 20:50:08 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDEEg-0000Mi-5g for pgsql-general@postgresql.org; Wed, 25 Sep 2019 20:50:08 +0000 Received: by mail-ed1-x52b.google.com with SMTP id p10so13157edq.1 for ; Wed, 25 Sep 2019 13:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=168xypzdMpmPoMHLhDm8mdqSxB+Cx385xwQdMAmB6zw=; b=jSE9qT+xvnUAWBsXelw/Y4uaeLcNaVvzJueoDVktKH0IlNmcD3g44MH93TowlUFFp6 xUdQndquo8Uim5N/gx2v6v45qwAD61vT3yL3XlsdwhVG6MVZfmQnrQjGP3RmmXtd9Y7e 0p/6vVEaLEpn0r6gNSWM4TB3HJ4EaC4EN8zdL61WCx/+Be4CPaz8WIWFBA4vzyS/6JFj qHUr2tnmEtZVHYhTftdn/C+193vHOpRXLYmkw2a2chptvVP824dk1m+2z7Estep55O/F p3dDCKhdVjtzSQayezjSeXMoP5GQXdKRR2R5xiT1mBTTGzV4sFsHdwQ26YpJ1GoYAYM5 ti7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=168xypzdMpmPoMHLhDm8mdqSxB+Cx385xwQdMAmB6zw=; b=TgGuqz3RtPRpw8hA8S20GEGk2t5lMwh7pxMs8Bf/u2RGvDrWBmsmX9wHQHNjQCt9Kb GTaDZKkPUuKsLQiBpg9D/CNyEmSVZKoAeZ8ENM7z/NBfryyPZxFySP6Rv3paIWfyXtzk vRpD85OdkbaTESte+nYFnxSs8uWqIVroQFQbuAKxMV9WEL7ZQkxugj/XM+1QpwqTIumf /lzJWGQbd2oUo9FI4LXDiEaODkSvVlCNQqauVTUtyHDXNKX5WtrZ1NkJi61ioTuQuDQz q4f+nZ1Glm4dBy6Dc3310gGcCCo2RpOn9o6uMM/Bx0/HR7m8eXyKBgMX97DpdrXjViTB xeBw== X-Gm-Message-State: APjAAAVUqT+lw1mP5BsnegoQmXiTzOuQ6L9jUoW2WaD99+0JvoUK3xps fH1mQb7hTX+U1xsZ/m3o3tjsx7yi X-Google-Smtp-Source: APXvYqy5Z/0xPuM60D5mL/mSmdXunf/V+IvHxKnVWgKbZdSmntKa/IDmBIk1bYUD3uh/vkeUYpNZ3w== X-Received: by 2002:a50:ef12:: with SMTP id m18mr5174206eds.18.1569444604895; Wed, 25 Sep 2019 13:50:04 -0700 (PDT) Received: from hollewijn.internal (217-19-30-105.dsl.cambrium.nl. [217.19.30.105]) by smtp.gmail.com with ESMTPSA id w7sm17654edr.77.2019.09.25.13.50.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Sep 2019 13:50:04 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Arrays and ANY problem From: Alban Hertroys In-Reply-To: Date: Wed, 25 Sep 2019 22:50:03 +0200 Cc: pgsql-general@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <775E048E-4316-4AFE-B4A7-A25AC79DE002@gmail.com> References: To: David Salisbury X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On 25 Sep 2019, at 22:25, David Salisbury wrote: > db=3D# select name from table_name_ds_tmp where ARRAY[categoryid] =3D = ANY ( select string_to_array( '200,400', ',')::bigint[] ); > name=20 > ------ > (0 rows) You are comparing two arrays for equality. Since the left-hand array has = only 1 item and the right-hand one has two, there=E2=80=99s not much = equality between them. You probably meant: select name from table_name_ds_tmp where categoryid =3D ANY ( select = string_to_array( '200,400', ',')::bigint[] ); Alban Hertroys -- There is always an exception to always.