From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Postgres - search for value throughout many tables?
Date: Wed, 8 Aug 2018 17:33:30 +0300
Message-ID: <56aae3f5-3e34-a643-9a08-8ac253b99fb3@matrix.gatewaynet.com> (raw)
In-Reply-To: <471629efc8bf4ad99a95379fa98e1a9e@grupawp.pl>
References: <471629efc8bf4ad99a95379fa98e1a9e@grupawp.pl>
If the num of tables is smallish you could run smth like
select * from (
select table1::text as thecol from table1
UNION select table2::text FROM table2
UNION select table3::text FROM table3
UNION .....
) as qry WHERE thecol ~* 'some pattern';
On 08/08/2018 17:09, czezz wrote:
> Hi everyone,
> I want to aks if anyone knows is there a way to search for specific "value" throughout list of tables OR all tables in databse?
>
> Cheers,
> czezz
--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: achill@matrix.gatewaynet.com
Subject: Re: Postgres - search for value throughout many tables?
In-Reply-To: <56aae3f5-3e34-a643-9a08-8ac253b99fb3@matrix.gatewaynet.com>
References: <471629efc8bf4ad99a95379fa98e1a9e@grupawp.pl> <56aae3f5-3e34-a643-9a08-8ac253b99fb3@matrix.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox