Re: [SQL] LinkedList

2006-04-27 Thread Neil Saunders
Ray, There's a good introductory article on Sitepoint for doing this kind of thing: http://www.sitepoint.com/article/hierarchical-data-database The "Modified Preorder Tree Traversal" is quite a nice method that I would expect to be a magnitude faster than recursive joins, although does have som

[SQL] Archives site down?

2005-11-30 Thread Neil Saunders
Apologies if this has been mentioned on announce (I'm not subscribed), but the mailing list archive site appears to have a problem (403 Forbidden): http://archives.postgresql.org/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner wi

Re: [SQL] Triggers

2005-11-22 Thread Neil Saunders
And change AFER INSERT to BEFORE INSERT On 11/22/05, Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > O Leif B. Kristensen έγραψε στις Nov 22, 2005 : > > > On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote: > > >O Leif B. Kristensen έγραψε στις Nov 22, 2005 : > > >> I'm trying to understa

Re: [SQL] Triggers

2005-11-22 Thread Neil Saunders
Try: create or replace function update_last_edit() returns trigger as $$ begin new.last_edit=now(); return new; end; $$ language plpgsql; On 11/22/05, Leif B. Kristensen <[EMAIL PROTECTED]> wrote: > On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote: > >O Leif B. Kristensen έγραψε στις N

Re: [SQL] Foreign key to 2 tables problem

2005-11-22 Thread Neil Saunders
As far as I'm aware, not without using an intermediatary table (id, cust_id, supplier_id) . Otherwise, how would you know which table the foreign key was referencing? That said, an intermediatary table isn't a very clean solution; What problem are you trying to solve, exactly? Kind Regards, Neil

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Neil Saunders
OK, you're not really "breaking" md5. If the attacker already knows the information being encrypted, then all you're testing is the concatenation order- Surely the information is more important than the order? md5 is a one way hash function, and so using an alternate algorithm will provide no benef

[SQL] Difference from average

2005-10-11 Thread Neil Saunders
Hi all, I'm developing a property rental database. One of the tables tracks the price per week for different properties: CREATE TABLE "public"."prices" ( "id" SERIAL, "property_id" INTEGER, "start_date" TIMESTAMP WITHOUT TIME ZONE, "end_date" TIMESTAMP WITHOUT TIME ZONE, "price" DOUBLE

[SQL] Triggers & Conditional Assignment

2005-09-15 Thread Neil Saunders
al assignment doesn't seem to be catered for. The next best thing is a series of IF THEN ELSIF ELSE statements to assign sdate and edate, or is there another technique that I've missed entirely? Kind Regards, Neil Saunders. ---(end of broadcast)