Re: Tables as function arguments

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Tables as function arguments
Дата
Msg-id 200403261612.59850.dev@archonet.com
обсуждение исходный текст
Ответ на Tables as function arguments  (Jeremy Semeiks <jrs@denny.farviolet.com>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: prob with really simple insert
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: CREATE TEMP TABLE