Re: [SQL] echo/printf function in plpgsql

2005-07-19 Thread John DeSoi
On Jul 19, 2005, at 11:58 AM, Andreas Joseph Krogh wrote: I see. Can I make the ouput somehow less verbose? It spits out a lot of noise for each "NOTICE": If you just want to output some information to the log, you can use something like this: raise log 't is %', t; If I recall correct

Re: [SQL] difference between all RDBMSs

2005-07-19 Thread Chris Travers
Obviously on this list you will mostly get info on PostgreSQL. With regard to PostgreSQL, I would highly suggest familiarizing yourself with the online documentation. I won't cover the weaknesses of MySQL here, but will give you a quick overview on how PostgreSQL is different from other RDBMS

[SQL] Coalesce() in outer join between views

2005-07-19 Thread Chris Travers
Hi everyone. I am trying to create a view that fills in missing values from a secondary source. I am using PostgreSQL 8.0.3 on Fedora Linux Core 3. I have two important views and two important tables. Everything works find by itself but when I try to create an outer join between views (tha

Re: [SQL] echo/printf function in plpgsql

2005-07-19 Thread Andreas Joseph Krogh
On Tuesday 19 July 2005 22:09, Tony Wasson wrote: > On 7/19/05, Andreas Joseph Krogh <[EMAIL PROTECTED]> wrote: > > On Tuesday 19 July 2005 17:18, Richard Huxton wrote: > > > Andreas Joseph Krogh wrote: > > > > Hi all! > > > > > > > > Is there a way of echo'ing a string(like "raise notice 'this is

Re: [SQL] echo/printf function in plpgsql

2005-07-19 Thread Tony Wasson
On 7/19/05, Andreas Joseph Krogh <[EMAIL PROTECTED]> wrote: > On Tuesday 19 July 2005 17:18, Richard Huxton wrote: > > Andreas Joseph Krogh wrote: > > > Hi all! > > > > > > Is there a way of echo'ing a string(like "raise notice 'this is id%', > > > id") from plpgsql? I want to echo/print it to STDO

Re: [SQL] funstions for parsing words

2005-07-19 Thread Tony Wasson
On 7/19/05, John Kopanas <[EMAIL PROTECTED]> wrote: > I have a table called Phrases that holds the text of a phrase. I want > write a query that will return all the words found in all the text of > the Phrases. Like so: > > > Phrases: > > "Hello World" > "Goodbye World" > "I like can

[SQL] funstions for parsing words

2005-07-19 Thread John Kopanas
I have a table called Phrases that holds the text of a phrase. I want write a query that will return all the words found in all the text of the Phrases. Like so: Phrases: "Hello World" "Goodbye World" "I like candy Words (select statement result): "Hello" "World" "Good

Re: [SQL] echo/printf function in plpgsql

2005-07-19 Thread Andreas Joseph Krogh
On Tuesday 19 July 2005 17:18, Richard Huxton wrote: > Andreas Joseph Krogh wrote: > > Hi all! > > > > Is there a way of echo'ing a string(like "raise notice 'this is id%', > > id") from plpgsql? I want to echo/print it to STDOUT 'cause the > > notice-mechanism produces too much noise IMH. > > Your

Re: [SQL] echo/printf function in plpgsql

2005-07-19 Thread Richard Huxton
Andreas Joseph Krogh wrote: Hi all! Is there a way of echo'ing a string(like "raise notice 'this is id%', id") from plpgsql? I want to echo/print it to STDOUT 'cause the notice-mechanism produces too much noise IMH. Your function is running in the backend. You don't have a STDOUT (although

[SQL] echo/printf function in plpgsql

2005-07-19 Thread Andreas Joseph Krogh
Hi all! Is there a way of echo'ing a string(like "raise notice 'this is id%', id") from plpgsql? I want to echo/print it to STDOUT 'cause the notice-mechanism produces too much noise IMH. -- Andreas ---(end of broadcast)--- TIP 2: Don't 'kill -9'

Re: [SQL] Postgres for Fedora Core 2 OS ****************

2005-07-19 Thread Halley Pacheco de Oliveira
There is the postgresql-8.0.3-1.i386.rpm for Fedora Core 4 in http://ftp.idilis.ro/mirrors/fedora/core/4/i386/os/Fedora/RPMS/ and others mirrors. I don't know if it works with Fedora Core 2. Probably not. For Fedora Core 3 there is the postgresql-7.4.6-1.FC3.1.i386.rpm in http://ftp.idilis.ro/m

Re: [SQL] Create trigger for auto update function

2005-07-19 Thread Andy
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 Bintintan wrote: Now, I want to w

Re: [SQL] Create trigger for auto update function

2005-07-19 Thread Richard Huxton
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;

Re: [SQL] Create trigger for auto update function >> SOLVED!!!

2005-07-19 Thread Andy
CREATE OR REPLACE FUNCTION u9() RETURNS TRIGGER AS' BEGIN NEW.pass_md5=md5(NEW.pass); return NEW; END 'language plpgsql; CREATE TRIGGER t8 BEFORE INSERT OR UPDATE ON hoy FOR EACH ROW EXECUTE PROCEDURE u9(); Ok. This is the solution. It works well, for inserts and updates. Took some tim

Re: [SQL] Create trigger for auto update function

2005-07-19 Thread daq
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

Re: [SQL] Create trigger for auto update function

2005-07-19 Thread Andy
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; I understand the ideea, but don't know ho