Re: Implementation of a bag pattern using rules

From: "Richard Sydney-Smith" <richard(at)ibisaustralia(dot)com>
To: "Mark Gibson" <gibsonm(at)cromwell(dot)co(dot)uk>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Implementation of a bag pattern using rules
Date: 2004-02-09 14:54:33
Message-ID: 001b01c3ef1c$a3034890$cee98a90@athlon2000
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)cromwell(dot)co(dot)uk>
To: <pgsql-sql(at)postgresql(dot)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:

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mark Roberts 2004-02-09 15:02:56 timestamptz - problems
Previous Message Paul Thomas 2004-02-09 14:28:19 Re: Index not used - now me