Re: searching a value in a variable/field in all tables in a schema - Mailing list pgsql-general

From David G. Johnston
Subject Re: searching a value in a variable/field in all tables in a schema
Date
Msg-id CAKFQuwaONZObovF2COnS_d1yH_pD4rhwOmyHL+O=fPJFHGwxZw@mail.gmail.com
Whole thread Raw
In response to searching a value in a variable/field in all tables in a schema  (Ruiqiang Chen <chenrq2005@gmail.com>)
Responses Re: searching a value in a variable/field in all tables in a schema
List pgsql-general
On Thu, Aug 30, 2018 at 1:44 PM, Ruiqiang Chen <chenrq2005@gmail.com> wrote:

Does anyone have experience of searching a value in a variable/field in all tables in a schema? 

 
SELECT 'Tbl1'::text AS loc, fld
FROM schema.tbl1
WHERE fld = 'value'
[UNION ALL
SELECT 'Tbl2'::text AS loc, fld
FROM schema.tbl2
WHERE fld = 'value'
...]

David J.

pgsql-general by date:

Previous
From: Ruiqiang Chen
Date:
Subject: searching a value in a variable/field in all tables in a schema
Next
From: Tim Cross
Date:
Subject: Re: Ways to deal with large amount of columns;