X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DF572D1B50B for ; Sat, 27 Sep 2003 12:38:01 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 13170-06 for ; Sat, 27 Sep 2003 09:37:54 -0300 (ADT) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by svr1.postgresql.org (Postfix) with ESMTP id E3F60D1B503 for ; Sat, 27 Sep 2003 09:37:50 -0300 (ADT) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id 9ED203F52; Sat, 27 Sep 2003 08:37:29 -0400 (EDT) From: "Dan Langille" To: Josh Berkus Date: Sat, 27 Sep 2003 08:38:27 -0400 MIME-Version: 1.0 Subject: Re: Removing simliar elements from a set Cc: pgsql-sql@postgresql.org Message-ID: <3F754C83.22347.29465C5B@localhost> References: <20030926184440.B301@laptop.unixathome.org> In-reply-to: <200309261655.13695.josh@agliodbs.com> X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/347 X-Sequence-Number: 15325 On 26 Sep 2003 at 16:55, Josh Berkus wrote: > Dan, > > > I'm trying to remove items from a set which are similar to items in > > another set. > > > > In short, we remove all items from MASTER which are under the directories > > specified in MATCHES. > > from your example, you are trying to remove all directories which do *not* > match. What do you want, exactly? Josh and I talked on IRC about this. This is the result set I want: /ports/Mk/bsd.python.mk I want things from MASTER which do not match things in MATCHES. Josh suggested this: SELECT * FROM master WHERE NOT EXISTS ( SELECT * FROM matches WHERE master.pathname LIKE (matches.pathname || '/%')); Cheers. -- Dan Langille : http://www.langille.org/