Re: Implementation of a bag pattern using rules - Mailing list pgsql-sql

From Richard Sydney-Smith
Subject Re: Implementation of a bag pattern using rules
Date
Msg-id 001b01c3ef1c$a3034890$cee98a90@athlon2000
Whole thread Raw
In response to Implementation of a bag pattern using rules  (Mark Gibson <gibsonm@cromwell.co.uk>)
Responses Re: Implementation of a bag pattern using rules
List pgsql-sql
Mark,

love the idea, guess I should have read it somewhere but haven't. Obvious
and beautiful. Please let me know if you or someone else solves the initial
double value.

Got me thinking of all the places I cold have used this instead of coding
select/insert/update/delete.
Also have you worked a solutions where both the abs and relative inserts
apply to the same bag

eg insert another apple vs set apples to 5

Much of my attitude to triggers has been non-committal. Your example changes
that.

Well thanks again

Richard Sydney-Smith

----- Original Message ----- 
From: "Mark Gibson" <gibsonm@cromwell.co.uk>
To: <pgsql-sql@postgresql.org>
Sent: Monday, February 09, 2004 8:42 PM
Subject: [SQL] Implementation of a bag pattern using rules


> Hello,
>     I've been playing around with a simple solution for a bag or sparse
> matrix using rules,
> but have encountered a few problems I wish to discuss.
> The bag pattern is commonly used for shopping baskets (item => quantity).
> This sollution can also be used for a sparse matrix too (row,col =>
value).
>
> Example:



pgsql-sql by date:

Previous
From: Paul Thomas
Date:
Subject: Re: Index not used - now me
Next
From: Christoph Haller
Date:
Subject: Re: Index not used - now me