Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6FED29FB49E for ; Fri, 23 Feb 2007 14:01:24 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 42675-05 for ; Fri, 23 Feb 2007 14:01:24 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web54306.mail.yahoo.com (web54306.mail.yahoo.com [206.190.49.116]) by postgresql.org (Postfix) with SMTP id AE9419FB519 for ; Fri, 23 Feb 2007 14:01:23 -0400 (AST) Received: (qmail 74519 invoked by uid 60001); 23 Feb 2007 18:01:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=pajbWcicG8rSA8p0y6pykqicWRVjotEKeGqCbA9hg7jEJ2TQZcgd0M41LRKBWQuappVNXHv/5R71Bm5+2YhQ8VaMbvfIIS3sl9qPbtQl3wegvry1GpIoHr04VcKYh9lqnK23iP/FSr+uKPEf0KynS6ZtOXe+tQQaAYEZSZshmpU=; X-YMail-OSG: WGQEGN4VM1kHmC.tLAVJfiRJVQDa3tgSEGi58OHgOU4PwpKxa1xfuuQ.XPVYb3tzXY5PO_ORGM2p2LPjkFG_zHdJl8CpUeGiXfnxePVmRM6voO4GYwAirGYfYM1DQ23pMb0c8QCKvWWJsPE- Received: from [24.10.123.39] by web54306.mail.yahoo.com via HTTP; Fri, 23 Feb 2007 10:01:22 PST Date: Fri, 23 Feb 2007 10:01:22 -0800 (PST) From: chester c young Subject: Re: simple web search To: Louis-David Mitterrand Cc: sql pgsql In-Reply-To: <20070223162731.GA25577@apartia.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <784381.72635.qm@web54306.mail.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/230 X-Sequence-Number: 27564 > I'm considering implementing a search box on my review web site > http://lesculturelles.net and am looking for a simple way to match > entered words against several columns on related tables: > show.show_name, story.title, person.firtname, person.lastname, etc. one solution would be a view: create view search_v as select 'show'::name as tab_nm, show_id as tab_pk, 'Show Name' as description, show_name as search from show union select 'story'::name, story_id, 'Story Title', title from story union ... your query would be select * from search_v where '$string' ilike search this would return a list the user could use to drill down further. many ways to skin this cat. ____________________________________________________________________________________ It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. http://tools.search.yahoo.com/toolbar/features/mail/