Re: Postgres - search for value throughout many tables? - Mailing list pgsql-general

From Achilleas Mantzios
Subject Re: Postgres - search for value throughout many tables?
Date
Msg-id 56aae3f5-3e34-a643-9a08-8ac253b99fb3@matrix.gatewaynet.com
Whole thread Raw
In response to Postgres - search for value throughout many tables?  (czezz <czezz@o2.pl>)
List pgsql-general
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
indatabse?
 
>
> Cheers,
> czezz


-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Postgres - search for value throughout many tables?
Next
From: czezz
Date:
Subject: Odp: Re: Postgres - search for value throughout many tables?