how to call stored procedures that are writes

From: Ross Boylan <ross(at)biostat(dot)ucsf(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: how to call stored procedures that are writes
Date: 2012-05-31 00:52:46
Message-ID: 4FC6C0DE.6080103@biostat.ucsf.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Suppose I have a function (stored procedure) whose purpose is to write
to the database. How would I call the function from a client? select?
It seems strange to use a select for something that writes rather than
reads.

Is there something other than functions I should use for this purpose?

I realize in some cases I could install the function as a trigger on
inserts or updates, but that also seems obscure.

E.g. I have a function f(a, b, c), where a, b, and c are single pieces
of information (e.g., a name, a date, a place) and the function f is
supposed to update one or more tables, perhaps after some processing.

Thanks.
Ross Boylan

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2012-05-31 05:23:56 Re: how to call stored procedures that are writes
Previous Message Steve Crawford 2012-05-30 18:18:04 Re: ERROR: invalid input syntax for integer