pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: daq <daq@ugyvitelszolgaltato.hu>
To: Andy <frum@ar-sd.net>
Cc: Pgsql-sql@postgresql.org
Subject: Re: Create trigger for auto update function
Date: Tue, 19 Jul 2005 10:10:51 +0200
Message-ID: <687885328.20050719101051@ugyvitelszolgaltato.hu> (raw)
In-Reply-To: <016401c58c37$43d52820$0b00a8c0@forge>
References: <00e001c58b93$ad30b130$0b00a8c0@forge>
	<1285936906.20050718153208@ugyvitelszolgaltato.hu>
	<016401c58c37$43d52820$0b00a8c0@forge>

Hello Andy,

Tuesday, July 19, 2005, 9:55:41 AM, you wrote:

>> CREATE FUNCTION update_pass() RETURNS integer AS $$
>>     UPDATE hoy SET pass_md5=md5(pass) WHERE id=new.id;
>>    SELECT 1;
>> $$ LANGUAGE SQL;
>>
>> CREATE TRIGGER triger_users_pass_md5
>>  AFTER INSERT OR UPDATE
>>  ON hoy FOR EACH ROW
>>     EXECUTE PROCEDURE update_pass;

A> I understand the ideea, but don't know how to apply it.
A> I also receive the error that NEW must be definde as a rule.

A> Still... not working...

Sorry! My fault. Trigger porcedure returns OPAQUE type.

 CREATE FUNCTION update_pass() RETURNS OPAQUE AS $$
     UPDATE hoy SET pass_md5=md5(pass) WHERE id=new.id;
    SELECT 1;
 $$ LANGUAGE SQL;



 DAQ




view thread (7+ messages)  latest in thread

Message-ID: <687885328.20050719101051@ugyvitelszolgaltato.hu>
Permalink:  ../687885328.20050719101051@ugyvitelszolgaltato.hu/
Also on:    postgresql.org/message-id/687885328.20050719101051@ugyvitelszolgaltato.hu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: daq@ugyvitelszolgaltato.hu, frum@ar-sd.net
  Subject: Re: Create trigger for auto update function
  In-Reply-To: <687885328.20050719101051@ugyvitelszolgaltato.hu>
  References: <00e001c58b93$ad30b130$0b00a8c0@forge> <1285936906.20050718153208@ugyvitelszolgaltato.hu> <016401c58c37$43d52820$0b00a8c0@forge> <687885328.20050719101051@ugyvitelszolgaltato.hu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox