[SQL] order of rows in update

2008-09-02 Thread Achilleas Mantzios
Hi, is there an (implicit) way to make a multirow update execute on some rows prior to other rows? It is needed in a case where a trigger is defined on the table as FOR EACH ROW, and it is mandatory that the trigger is run for some certain rows before it is run on the rest of the rows. Is there

Re: [SQL] order of rows in update

2008-09-02 Thread Richard Broersma
On Tue, Sep 2, 2008 at 2:58 AM, Achilleas Mantzios <[EMAIL PROTECTED]> wrote: > is there an (implicit) way to make a multirow update execute on some rows > prior to other rows? > It is needed in a case where a trigger is defined on the table as FOR EACH > ROW, and it is mandatory > that the trigg

[SQL] How do I get min and max from an array of floating point values

2008-09-02 Thread pw
Hello, Is it possible to get the min and max from an array of floating point values? The following doesn't return the min of the array values it simply returns the complete array...(??) SELECT min(string_to_array('1,2,3,4,5,6,7',',')::float[]); Thanks Peter -- Sent via pgsql-sql mailing list

[SQL] seemingly slow for-loop in plpgsql

2008-09-02 Thread Claus Guttesen
Hi. I have a table with a hashcode-field which is a md5-checksum of a file. I updated all null-entries using a rails-script by calling '/sbin/md5 -q' (on FreeBSD). When all null-entries were updated I found out that '\n' was added to the md5-checksum. :-) So I wanted to update the table using plp

Re: [SQL] seemingly slow for-loop in plpgsql

2008-09-02 Thread Tom Lane
"Claus Guttesen" <[EMAIL PROTECTED]> writes: > create or replace function update_hashcode() returns setof duplicates as > $body$ > declare > d duplicates%rowtype; > h text; > begin > for d in select * from duplicates where length(hashcode) = 33 loop > h := rtrim(d.hashcode, E'\n'); >

Re: [SQL] order of rows in update

2008-09-02 Thread Achilleas Mantzios
Στις Tuesday 02 September 2008 17:24:05 ο/η Richard Broersma έγραψε: > On Tue, Sep 2, 2008 at 2:58 AM, Achilleas Mantzios > <[EMAIL PROTECTED]> wrote: > > is there an (implicit) way to make a multirow update execute on some rows > > prior to other rows? > > It is needed in a case where a trigger i