[SQL] Removing redundant itemsets

2008-03-31 Thread Allan Kamau
Hi all, I have a list of purchases (market basket) and I would like to select non redundant longest possible patterns by eliminating (creating/populating other table to contain only non redandant itemsets) purchases having item lists which are fully included in at least one other purchase. (Am

Re: [SQL] Removing redundant itemsets

2008-03-31 Thread Craig Ringer
Allan Kamau wrote: Hi all, I have a list of purchases (market basket) and I would like to select non redundant longest possible patterns by eliminating (creating/populating other table to contain only non redandant itemsets) purchases having item lists which are fully included in at least one

Re: [SQL] Removing redundant itemsets

2008-03-31 Thread Craig Ringer
Craig Ringer wrote: Allan Kamau wrote: Hi all, I have a list of purchases (market basket) and I would like to select non redundant longest possible patterns by eliminating (creating/populating other table to contain only non redandant itemsets) purchases having item lists which are fully

Re: [SQL] Removing redundant itemsets

2008-03-31 Thread Craig Ringer
-- Find any `a' for which `item_from_a_is_in_b' is -- true for all items in `a' SELECT a_tid AS is_redundant, b_tid AS contained_by FROM ( -- For every item in every pair of purchases, -- determine whether the item in purchase `a' -- was also in purchase `b'. SELECT a.tid AS

Re: [SQL] Removing redundant itemsets

2008-03-31 Thread Allan Kamau
Craig, Thank you so much for the solution. I have spent many hours since Thursday last week including the weekend (and it took you just a few minutes) trying to figure out a solution not involving procedural programming and looping (as the size of the items and even the number of purchases in

[SQL] drop table where tableName like 'backup_2007%' ?

2008-03-31 Thread Emi Lu
Good morning, Is there a command to drop tables whose name begins a specific string? For example, all backup tables begins with backup_2007: Drop table where tableName like 'backup_2007%'? Thanks a lot! -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] drop table where tableName like 'backup_2007%' ?

2008-03-31 Thread Tom Lane
Emi Lu [EMAIL PROTECTED] writes: Is there a command to drop tables whose name begins a specific string? No. The standard answer to this type of problem is to write a little plpgsql function that scans the appropriate catalog and issues commands constructed with EXECUTE. for r in select

Re: [SQL] drop table where tableName like 'backup_2007%' ?

2008-03-31 Thread Richard Huxton
Tom Lane wrote: Note that the above is overly simplistic --- it doesn't pay attention to schemas, for example. These are what I use. BEGIN; CREATE SCHEMA util; CREATE OR REPLACE FUNCTION util.exec_all(objtype name, schname name, objname name, cmd TEXT) RETURNS text AS $$ DECLARE

[SQL] specifying wal file size

2008-03-31 Thread gherzig
Hi dudes. Im trying to find out how to deal with this. I just receive a 1.2 MB wal file (may some 'windows home version' do that?), and obviosly, when i try to recovery from there, get the 'incorrect file size' error. Acording to the docs, wal file size can be changed at compile time. Not so bad,

Re: [SQL] specifying wal file size

2008-03-31 Thread Tom Lane
[EMAIL PROTECTED] writes: Hi dudes. Im trying to find out how to deal with this. I just receive a 1.2 MB wal file (may some 'windows home version' do that?), and obviosly, when i try to recovery from there, get the 'incorrect file size' error. Acording to the docs, wal file size can be changed