Re: Effective query for listing flags in use by messages in a folder - Mailing list pgsql-sql

From Andreas Joseph Krogh
Subject Re: Effective query for listing flags in use by messages in a folder
Date
Msg-id VisenaEmail.35.3a752eb0ccc59659.14c2cf6ffdf@tc7-visena
Whole thread Raw
In response to Re: Effective query for listing flags in use by messages in a folder  (Hector Vass <hector.vass@metametrics.co.uk>)
Responses Re: Effective query for listing flags in use by messages in a folder
List pgsql-sql
På onsdag 18. mars 2015 kl. 13:54:50, skrev Hector Vass <hector.vass@metametrics.co.uk>:

OK I get it ..

 

drop type if exists myflags cascade;
create type myflags as enum('is_seen','is_replied','is_forwarded','is_deleted','is_draft','is_flagged');
drop table if exists message;
create table message(
    folder_id integer not NULL,
    msg varchar(200),
    is_flag myflags
);
insert into message values
(1,'msg b','is_seen'),
(1,'msg c','is_seen'),
(1,'msg d','is_seen'),
(1,'msg d','is_replied'),
(1,'msg e','is_seen'),
(1,'msg e','is_replied'),
(1,'msg h','is_deleted')
;
 
Not quite; you have 2 entries, one for each flag, for "msg d". I must have one tuple per message in this table.
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 
Attachment

pgsql-sql by date:

Previous
From: Hector Vass
Date:
Subject: Re: Effective query for listing flags in use by messages in a folder
Next
From: Hector Vass
Date:
Subject: Re: Effective query for listing flags in use by messages in a folder