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

Re: Fw: triggers

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Iandé Coutinho <iande(at)br(dot)inter(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Fw: triggers
Date: 2004-04-16 14:26:43
Message-ID: 20040416142643.GA32424@wolff.to (view raw or flat)
Thread:
Lists: pgsql-novice
On Fri, Apr 16, 2004 at 10:17:16 -0300,
  Iandé Coutinho <iande(at)br(dot)inter(dot)net> wrote:
> Anyone??

A simple way to do this would be to create a view with the calculated column.

> ----- Original Message ----- 
> From: "Iandé Coutinho" <iande(at)br(dot)inter(dot)net>
> To: <pgsql-novice(at)postgresql(dot)org>
> Sent: Thursday, April 15, 2004 3:49 PM
> Subject: [NOVICE] triggers
> 
> 
> Afternoon guys, I would be very gratefull if anyone could help me on this
> one. I´ve tried looking for examples on it, i know it´s simple, but i can´t
> get one, so here goes. I need to create a trigger(after insert), preferebly
> in plpgsql, as I have already created the lang using createlang, that, takes
> value from 2 columns of the record it´s inserting, and  concatenate together
> and insert it into a 3rd column,
> for example:
> 
> I have a table:
> 
> employee
> 
> id  | branch | name | uniqueId
> ---|--------|-------|---------
> 
> on insert into employee(id,branch,name) values(1,1543,"iande");
> 
> the trigger would get both id and branch valeus and insert on uniqueId
> so,
> 
> select * from employee;
> 
> id  | branch | name | uniqueId
> -----------------------------
> 1  | 1543    | iande | 15431
> 
> 
> thanks in advance;
> 
> Iandé
> 
> 
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2004-04-16 15:24:58
Subject: Re: Installing 7.4.2 - ./configure error
Previous:From: Iandé CoutinhoDate: 2004-04-16 14:22:26
Subject: Re: triggers

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