Off topic
:) I think we posted in the same time :))
- Original Message -
From: "Richard Huxton"
To: "Andrei Bintintan" <[EMAIL PROTECTED]>
Cc:
Sent: Tuesday, July 19, 2005 12:11 PM
Subject: Re: [SQL] Create trigger for auto update function
Andrei Bintint
Andrei Bintintan wrote:
Now, I want to write a trigger function that automatically updates the pass_md5 with the md5 function of the pass.
I tried this:
CREATE FUNCTION update_pass(integer) RETURNS integer AS $$
UPDATE hoy SET pass_md5=md5(pass) WHERE id=$1;
SELECT 1;
$$ LANGUAGE SQL;
Took some
time to figure it out.
(ignore the function names --- test functions)
Best regards,
Andy.
- Original Message -
From: "daq" <[EMAIL PROTECTED]>
To: "Andrei Bintintan" <[EMAIL PROTECTED]>
Cc:
Sent: Monday, July 18, 2005 4:32 PM
Subject: Re: [SQ
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
know how to apply it.
I also receive the error that NEW must be definde as a rule.
Still... not working...
- Original Message -
From: "daq" <[EMAIL PROTECTED]>
To: "Andrei Bintintan" <[EMAIL PROTECTED]>
Cc:
Sent: Monday, July 18, 2005 4:32 PM
Subje
Hello Andrei,
Monday, July 18, 2005, 2:24:41 PM, you wrote:
AB> Hi to all,
AB> I have a table:
AB> create table hoy(
AB> id serial,
AB> pass varchar(40),
AB> pass_md5 varchar(40);
AB> Now, I want to write a trigger function that automatically updates the
pass_md5 with the md5 function of th
CREATE TRIGGER triger_users_pass_md5
AFTER INSERT OR UPDATE
ON hoy
EXECUTE PROCEDURE update_pass(integer);
Try : FOR EACH ROW EXECUTE
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
Hi to all,
I have a table:
create table hoy(
id serial,
pass varchar(40),
pass_md5 varchar(40);
Now, I want to write a trigger function that
automatically updates the pass_md5 with the md5 function of the pass.
I tried this:
CREATE FUNCTION update_pass(integer) RETURNS
integer AS