Re: Tables as function arguments

From: Richard Huxton <dev(at)archonet(dot)com>
To: Jeremy Semeiks <jrs(at)denny(dot)farviolet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Tables as function arguments
Date: 2004-03-26 16:12:59
Message-ID: 200403261612.59850.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday 24 March 2004 04:31, Jeremy Semeiks wrote:
> Hello,
>
> I use psql interactively for data exploration, and often I want to do
> the same types of generic set operations on data in many different
> tables. For example, to calculate a similarity metric between 2
> different tables I might type:
[snip]
> ... plpy.execute("select * from "+args[0]+" union select * from "+args[1])
> ...
>
> But calling this function on the results of subselects turns into a
> big syntactic mess. Is there a better way to do this kind of thing?

Not really - you might be able to use some sprintf() equivalent to make the
syntax prettier (or different, anyway) but you'll need to build a dynamic
query.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-03-26 16:19:22 Re: PHP or JSP? That is the question.
Previous Message Robert Treat 2004-03-26 16:08:49 Re: Where are these tables??