Plpgsql qestion - Mailing list pgsql-general

From Yury Don
Subject Plpgsql qestion
Date
Msg-id 005a01bf267e$90784880$e23426c3@vpcit.ru
Whole thread Raw
List pgsql-general
 Hi All.

 Is it possible to create function (preferably in plpgsql) which gets table
name and field name as an arguments and does select something from this
table?
Something like

 CREATE FUNCTION "ft"
   (text, text)
   RETURNS int4
   AS '
   declare
      res int4;
   begin
      select max($2) from $1 into res;
      return res;
   end;
   '
   LANGUAGE 'plpgsql'

 Sincerely yours, Yury.
don.web-page.net, ICQ 11831432




pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] 6.5 connection time: too slow (?)
Next
From: "Gene Selkov, Jr."
Date:
Subject: Re: [GENERAL] indexed regex select optimisation missing?