pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gunther Schadow <gunther@aurora.regenstrief.org>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Support for distributed queries with semijoins could be possible, if ...
Date: Sun, 09 Jun 2002 15:00:58 -0400
Message-ID: <6693.1023649258@sss.pgh.pa.us> (raw)
In-Reply-To: <3D0393D0.2070208@aurora.regenstrief.org>
References: <3D0393D0.2070208@aurora.regenstrief.org>

Gunther Schadow <gunther@aurora.regenstrief.org> writes:
> SELECT fever.patient_id AS patient_id,
>         fever.value      AS fever,
>         wbc.value        AS wbc
>    FROM (SELECT patient_id, value
>            FROM STDIN) fever
>       INNER JOIN Observation wbc
>          ON fever.patient_id = wbc.patient_id
>   WHERE wbc.type_code = 'WHITE BLOOD CELL COUNT'
>     AND wbc.value < 1000;

A much more direct way of doing it is to leave the client out of the
loop.  The data from system A could be pulled directly into system B,
using e.g. Joe Conway's contrib/dblink package.  dblink is pretty
awkward to use in 7.2 but in 7.3 it should be a lot nicer --- the
returned data can be treated as a table function...

			regards, tom lane



view thread (2+ messages)

Message-ID: <6693.1023649258@sss.pgh.pa.us>
Permalink:  ../6693.1023649258@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6693.1023649258@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gunther@aurora.regenstrief.org
  Subject: Re: Support for distributed queries with semijoins could be possible, if ...
  In-Reply-To: <6693.1023649258@sss.pgh.pa.us>

* 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