LIKE query over multiple fields - Mailing list pgsql-sql

From Nathan Hand
Subject LIKE query over multiple fields
Date
Msg-id Pine.LNX.3.96.990107074146.23443A-100000@wookie.chirp.com.au
Whole thread Raw
List pgsql-sql
I'm doing something like the following

   select * from mytable
     where field1 like '%pattern%' or field2 like '%pattern%';

I actually have 60+ fields so I found that the following was more
convenient even though it's not exactly the same.

   select * from mytable
     where (field1||field2) like '%pattern%';

My question is, can this be done in a cleaner way? Something that
works similarly to the first example by preference. I thought

   select * from mytable
     where * like '%pattern%';

Logically described what I wanted, but of course this didn't work
with postgresql (or any other xbase, as far as I can tell).

Please CC: responses to me, if that's convenient. I read the psql
mailing list via an archive which isn't always in sync.


pgsql-sql by date:

Previous
From: "Jackson, DeJuan"
Date:
Subject: RE: [SQL] Kind of Funny
Next
From: "Tim Perdue, The Des Moines City.net"
Date:
Subject: Importing Fixed-Width File?