Re: [SQL] record fields as columns in reports

2007-06-28 Thread A. Kretschmer
am Thu, dem 28.06.2007, um 16:46:15 +0200 mailte Reinoud van Leeuwen folgendes: > Hi everybody, > > I have a script that runs every night and produces a list of a few error > conditions and the number. > > My manager would like it in a form where he can produce some charts in a > spreadsheet (

Re: [SQL] SQL problem...

2007-06-28 Thread Rodrigo De León
On Jun 28, 1:43 pm, "Bauhaus" <[EMAIL PROTECTED]> wrote: > I have the following table Price: > > FuelID PriceDate Price > LPG1/05/2007 0,2 > LPG13/05/2007 0,21 > SPS 2/05/2007 1,1 > SPS 15/05/2007 1,08 > > And I have to make the following query: > > FuelID PriceDate_from Price

Re: [SQL] Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?

2007-06-28 Thread Andreas Joseph Krogh
On Thursday 28 June 2007 17:54:59 Tom Lane wrote: > Andreas Joseph Krogh <[EMAIL PROTECTED]> writes: > > Anybody knows if queries of type "LIKE '%234%'" ever will be able to use > > indexes, and if someone is working on it? > > Perhaps you are looking for full text search (contrib/tsearch2)? No, I

Re: [SQL] Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?

2007-06-28 Thread Tom Lane
Andreas Joseph Krogh <[EMAIL PROTECTED]> writes: > Anybody knows if queries of type "LIKE '%234%'" ever will be able to use > indexes, and if someone is working on it? Perhaps you are looking for full text search (contrib/tsearch2)? regards, tom lane -

Re: [SQL] Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?

2007-06-28 Thread Andreas Joseph Krogh
On Thursday 28 June 2007 17:20:56 Tom Lane wrote: > Andreas Joseph Krogh <[EMAIL PROTECTED]> writes: > > Anybody knows if the following query will use an index-scan in PG-8.3? > > SELECT name FROM person WHERE name LIKE 'and%'; > > I know this works in "C"-locale, but I need it with UTF-8, > > "C l

Re: [SQL] record fields as columns in reports

2007-06-28 Thread Rodrigo De León
On 6/28/07, Reinoud van Leeuwen <[EMAIL PROTECTED]> wrote: So the table I store the errormessages in has a format like this: CREATE TABLE repport_history ( rundate date, errordescription character varying(255), number bigint ) And I would like an output with something like: 06

Re: [SQL] record fields as columns in reports

2007-06-28 Thread Andrew Sullivan
On Thu, Jun 28, 2007 at 04:46:15PM +0200, Reinoud van Leeuwen wrote: > And I would like an output with something like: > > 06/22 06/2306/2406/25 > ERROR1 10 10 9 8 > ERROR2250300 220 200 > ERROR3 4 2 0

Re: [SQL] Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?

2007-06-28 Thread Tom Lane
Andreas Joseph Krogh <[EMAIL PROTECTED]> writes: > Anybody knows if the following query will use an index-scan in PG-8.3? > SELECT name FROM person WHERE name LIKE 'and%'; > I know this works in "C"-locale, but I need it with UTF-8, "C locale" and "UTF8" are entirely orthogonal things.

[SQL] record fields as columns in reports

2007-06-28 Thread Reinoud van Leeuwen
Hi everybody, I have a script that runs every night and produces a list of a few error conditions and the number. My manager would like it in a form where he can produce some charts in a spreadsheet (that's probably why he's a manager ";-). So the table I store the errormessages in has a forma

Re: [SQL] Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?

2007-06-28 Thread Pavel Stehule
Hello, it's possible. You have to use varchar_pattern_ops: CREATE INDEX like_index ON person(name varchar_pattern_ops); Regards Pavel Stehule 2007/6/28, Andreas Joseph Krogh <[EMAIL PROTECTED]>: Hi all. Anybody knows if the following query will use an index-scan in PG-8.3? SELECT name FROM p

[SQL] Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?

2007-06-28 Thread Andreas Joseph Krogh
Hi all. Anybody knows if the following query will use an index-scan in PG-8.3? SELECT name FROM person WHERE name LIKE 'and%'; I know this works in "C"-locale, but I need it with UTF-8, probably the rest of the world soon too... -- Andreas Joseph Krogh <[EMAIL PROTECTED]> Senior Software Devel