Re: PL/pgSQL Question

From: "Mitch Vincent" <mitch(at)venux(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: PL/pgSQL Question
Date: 2001-01-23 00:04:27
Message-ID: 005501c084d0$0d9311a0$0200000a@windows
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Er, I'm pretty sure I found what I was looking for, sorry to waste
everyone's time.. I looked right past half the documentation!

-Mitch

----- Original Message -----
From: "Mitch Vincent" <mitch(at)venux(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Monday, January 22, 2001 6:56 PM
Subject: PL/pgSQL Question

> I haven't used PL/pgSQL very much but it looks like a good language in
which
> to make some simple functions for this application I'm writing..
>
> Is it possible (with PL/pgSQL) to access other records in other tables
than
> the tuple that pulled the trigger (and called the function)?
>
> Say this (pseudo code):
>
> When a record is added to the invoice_payments table have a trigger fire
and
> call this function :
>
> total_invoice()
>
> exec_sql -> UPDATE invoices SET total = total + <amount in amount_field in
> the tuple> WHERE invoice_id=<value in the invoice ID of this tuple>
>
>
>
> That's basically all I'd have to do.. There are a lot of these things that
> could be handled by the backend and would make my life much easier..
>
> I looked in the documentation but the examples only talk about rearranging
> values within the tuple that fired the trigger which called the function
> (wow, a mouth full).
>
> Thanks!
>
> -Mitch
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mikheev, Vadim 2001-01-23 00:44:04 RE: OID/XID allocation (was Re: is PG able to handle a >500 GB Da tabase?)
Previous Message Bruce Momjian 2001-01-23 00:02:13 Re: OID/XID allocation (was Re: is PG able to handle a >500 GB Database?)