Re: How do you query all columns and all tables for a specific string

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: How do you query all columns and all tables for a specific string
Date: 2010-03-23 06:04:04
Message-ID: 20100323060404.GB23688@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

In response to Ryan Garvey :
> I recently inhereted a database that I know nothing about that has hundreds of
> tables most of which have meaningless names, or at least to me. I am trying to
> find a table and column that holds a specific serial number. I have no idea
> what table or what column it would be stored in. Is it possible to search the
> entire database?

That's not the usual way to deal with a database, but you can create a
database-dump and use tools like grep to find your number in the dump. I
think, this is the fastest way. If you have found your number you can
read the dump to obtain, which table/column holds this value.

Regards, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andreas Gaab 2010-03-23 08:13:49 Re: string functions and operators
Previous Message Petru Ghita 2010-03-23 03:52:46 Re: string functions and operators