pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabian Peters <fabian@ngi.de>
To: PostgreSQL-Admin <pgsql-admin@postgresql.org>
Subject: [OT?] Derived attributes
Date: Wed, 15 Jan 2003 14:48:50 +0100
Message-ID: <BA4B2552.6A1E%fabian@ngi.de> (raw)

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




Message-ID: <BA4B2552.6A1E%fabian@ngi.de>
Permalink:  ../BA4B2552.6A1E%25fabian@ngi.de/
Also on:    postgresql.org/message-id/BA4B2552.6A1E%fabian@ngi.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: fabian@ngi.de
  Subject: Re: [OT?] Derived attributes
  In-Reply-To: <BA4B2552.6A1E%fabian@ngi.de>
  References: <BA4B2552.6A1E%fabian@ngi.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox