Skip site navigation (1) Skip section navigation (2)

querying for groups of data with similar properties

From: Lonni J Friedman <netllama(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: querying for groups of data with similar properties
Date: 2011-04-12 09:21:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
I have a table full of automated test data, which continuously has new
unique data inserted:

     Column     |            Type             |
 id             | integer                     | not null default
 testname       | text                        | not null
 last_update    | timestamp without time zone | not null default now()
 current_status | text                        | not null
 os             | text                        | not null
 arch           | text                        | not null
 build_type     | text                        | not null
 branch         | text                        | not null

The 'testname' column contains many different tests, and each unique
'testname' has numerous different associated os,arch,build_type &
branch values.  For example, testname='foo' will run on
os='Linux',arch='i686',build_type='debug',branch='t38', and also on
os='Windows7',arch='x86_64',build_type='release',branch='r40', etc,
and there will be many other different testname's with similar
permutations of the os,arch,build_type & branch columns.

The current_status column is either 'PASSED' or 'FAILED'.

What I'm struggling with is how to put together a SQL query which
shows me all instances of a given testname permutation
(os,arch,build_type,branch) which has a current_status value of
'FAILED' for two or more consecutive 'last_update' values.

Suggestions welcome.

thanks in advance!

pgsql-novice by date

Next:From: VenkateshDate: 2011-04-15 07:19:46
Subject: Hi
Previous:From: Christian BDate: 2011-04-12 07:12:57
Subject: Postgres extension for recurring Events

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group