Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

Next:From: Andreas GaabDate: 2010-03-23 08:13:49
Subject: Re: string functions and operators
Previous:From: Petru GhitaDate: 2010-03-23 03:52:46
Subject: Re: string functions and operators

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group