Skip site navigation (1) Skip section navigation (2)

Re: Functions which use an argument to decide which table to read

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Functions which use an argument to decide which table to read
Date: 2009-10-09 12:23:29
Message-ID: 20091009122329.GG19581@a-kretschmer.de (view raw or flat)
Thread:
Lists: pgsql-novice
In response to Jonathan Harden :
> Hello,
> 
>  
> 
> I am trying to write a function which takes an argument and uses that argument
> to return a set of rows from a table with the name given (or possibly inferred)
> from the argument.

You have to use EXECUTE. Build a string that contains your select, and
execute that string.

Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2009-10-09 14:05:16
Subject: Re: Functions which use an argument to decide which table to read
Previous:From: Jonathan HardenDate: 2009-10-09 11:56:00
Subject: Functions which use an argument to decide which table to read

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group