Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5E21347659E for ; Wed, 15 Jan 2003 08:52:28 -0500 (EST) Received: from mx2.ngi.de (mx2.ngi.de [213.191.74.84]) by postgresql.org (Postfix) with ESMTP id A404A4763C5 for ; Wed, 15 Jan 2003 08:49:51 -0500 (EST) Received: (qmail 4841 invoked from network); 15 Jan 2003 13:49:56 -0000 Received: from unknown (HELO [217.184.48.234]) ([217.184.48.234]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 15 Jan 2003 13:49:56 -0000 User-Agent: Microsoft-Entourage/10.1.1.2418 Date: Wed, 15 Jan 2003 14:48:50 +0100 Subject: [OT?] Derived attributes From: Fabian Peters To: PostgreSQL-Admin Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-AntiVirus: scanned for viruses by NGI Next Generation Internet (http://www.ngi.de/) X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/157 X-Sequence-Number: 6999 Hi folks, sorry if this might seem a bit too specific to WebObjects: I've used a couple of derived attributes in my WebObjects app's EOModel. Simple stuff along the lines of: (SELECT COUNT(*) FROM address WHERE address.eoid_customer = customer.eoid) in the Customer entity. (eoid being pk and eoid_customer fk) This worked nicely with OpenBase, i.e. it simply returned the number of addresses a particular customer has registered. Using the same expression with Postgres returns in fact the row count of the address table. Is there a way to make Postgres use the eoid of the current row instead of checking for matches between eoid_customer and _any_ eoid in the customer table? Any hints greatly appreciated! Fabian