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.92) (envelope-from ) id 1jBIGM-0000GI-A8 for pgsql-general@arkaria.postgresql.org; Mon, 09 Mar 2020 13:16:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jBIGJ-00018j-IC for pgsql-general@arkaria.postgresql.org; Mon, 09 Mar 2020 13:16:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jBIGJ-00018c-53 for pgsql-general@lists.postgresql.org; Mon, 09 Mar 2020 13:16:03 +0000 Received: from mail.caido.ro ([86.107.248.7] helo=caido.ro) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jBIGF-0001Zo-T2 for pgsql-general@lists.postgresql.org; Mon, 09 Mar 2020 13:16:01 +0000 Received: from localhost (localhost [127.0.0.1]) by caido.ro (Postfix) with ESMTP id 5E6BFC0C45 for ; Mon, 9 Mar 2020 15:18:34 +0200 (EET) Received: from caido.ro ([127.0.0.1]) by localhost (caido.ro [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id LsasjtCmCC-W for ; Mon, 9 Mar 2020 15:18:33 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by caido.ro (Postfix) with ESMTP id 9E368C0C46 for ; Mon, 9 Mar 2020 15:18:33 +0200 (EET) X-Virus-Scanned: amavisd-new at caido.ro Received: from caido.ro ([127.0.0.1]) by localhost (caido.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id f73vAIhTS58i for ; Mon, 9 Mar 2020 15:18:33 +0200 (EET) Received: from [192.168.88.2] (unknown [89.43.152.14]) by caido.ro (Postfix) with ESMTPSA id 487F6C0C45 for ; Mon, 9 Mar 2020 15:18:33 +0200 (EET) From: "Sterpu Victor" To: pgsql-general@lists.postgresql.org Subject: Query to retrieve the index columns when a function is used. Date: Mon, 09 Mar 2020 13:15:49 +0000 Message-Id: Reply-To: "Sterpu Victor" User-Agent: eM_Client/7.0.27943.0 Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------=_MBD6D8808D-1EA0-4C2A-A612-9A176A8E99A2" X-Antivirus: Avast (VPS 200308-0, 03/08/2020), Outbound message X-Antivirus-Status: Clean List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --------=_MBD6D8808D-1EA0-4C2A-A612-9A176A8E99A2 Content-Type: text/plain; format=flowed; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello I'm testing on Postgresql 12.1 and I have a index like this: "check_dates_gist" EXCLUDE USING gist (id_test1 WITH =3D, id_test2 WITH =3D= , tsrange(valid_from::timestamp without time zone, valid_to::timestamp without time zone) WITH &&) When I run this query: "select pc.relname, pi.indisunique, pi.indisprimary, array_agg(a.attname) as attname FROM pg_class pc JOIN pg_index pi ON pc.oid =3D pi.indexrelid AND pc.oid IN (SELECT indexrelid FROM pg_index, pg_class WHERE pg_class.relname=3D'test' = AND pg_class.oid=3Dpg_index.indrelid) JOIN pg_attribute a ON a.attrelid =3D pc.oid GROUP BY pc.relname,pi.indisunique, pi.indisprimary;" I retrieve the index but there is no detail about the columns valid_from and valid_to. How can I retrieve this detail? Thank you. -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus --------=_MBD6D8808D-1EA0-4C2A-A612-9A176A8E99A2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
=C2=A0 =C2=A0 =C2=A0Hello=

I'm testing on Postgresql 12.1 and I have a index like this:
"check_dates_gist" EXCLUDE USING gist (id_test1 WITH =3D, id_test2 WITH =3D, tsrange(valid_from::timestamp without time zone, valid_to::timestamp without time zone) WITH &&)

When I run this query:
"select pc.relname, pi.indisunique, pi.indisprimary, array_agg(a.attname) as attname
FROM pg_class pc
JOIN pg_index pi ON pc.oid =3D pi.indexrelid AND pc.oid IN
(SELECT indexrelid FROM pg_index, pg_class WHERE pg_class.relname=3D'test' AND pg_class.oid=3Dpg_index.indrelid)
JOIN pg_attribute a ON a.attrelid =3D pc.oid
GROUP BY pc.relname,pi.indisunique, pi.indisprimary;"
I retrieve the index but there is no detail about the columns valid_from and valid_to.

How can I retrieve this detail?
Thank you.

3D"" Virus-= free. www.avast.com
--------=_MBD6D8808D-1EA0-4C2A-A612-9A176A8E99A2--