Re: [SQL] have you feel anything when you read this ?

2006-04-05 Thread Stephan Szabo
On Thu, 6 Apr 2006, Eugene E. wrote: > Stephan Szabo wrote: > > On Wed, 5 Apr 2006, Eugene E. wrote: > > > > > >>Stephan Szabo wrote: > >> > >>>On Tue, 4 Apr 2006, Eugene E. wrote: > >>> > >>> > >>> > Stephan Szabo wrote: > > > >On Fri, 31 Mar 2006, Eugene E. wrote: > > > >>

Re: [SQL] have you feel anything when you read this ?

2006-04-05 Thread Eugene E.
Stephan Szabo wrote: On Wed, 5 Apr 2006, Eugene E. wrote: Stephan Szabo wrote: On Tue, 4 Apr 2006, Eugene E. wrote: Stephan Szabo wrote: On Fri, 31 Mar 2006, Eugene E. wrote: Peter Eisentraut wrote: Eugene E. wrote: the problem is: you'll get this four byte sequence '\00

Re: [SQL] problem comparing strings when different cluster / database encoding

2006-04-05 Thread Alvaro Herrera
Tomas Vondra wrote: Hi, > I've encountered a strange problem. We have a PG 8.0.x database cluster > (in the sense used in initdb, i.e. bunch of databases) created with > UNICODE encoding, namely cs_CZ.UTF-8 locale. > > When a database is created with a different encoding (in our case it's > LATI

Re: [SQL] problem comparing strings when different cluster / database encoding

2006-04-05 Thread Tom Lane
Tomas Vondra <[EMAIL PROTECTED]> writes: > I've encountered a strange problem. We have a PG 8.0.x database cluster > (in the sense used in initdb, i.e. bunch of databases) created with > UNICODE encoding, namely cs_CZ.UTF-8 locale. > When a database is created with a different encoding (in our cas

[SQL] problem comparing strings when different cluster / database encoding

2006-04-05 Thread Tomas Vondra
Greetings, I've encountered a strange problem. We have a PG 8.0.x database cluster (in the sense used in initdb, i.e. bunch of databases) created with UNICODE encoding, namely cs_CZ.UTF-8 locale. When a database is created with a different encoding (in our case it's LATIN2) the string comparison

Re: [SQL] SELECT composite type

2006-04-05 Thread Tom Lane
Niklas Johansson <[EMAIL PROTECTED]> writes: > On 5 apr 2006, at 17.57, Michael Burke wrote: >> So I basically want to call get_xy for every row in >> sightings, and use its output for two columns; or perhaps there is >> another way to think of this. > You could try > SELECT foo.x, foo.y, title

Re: [SQL] SELECT composite type

2006-04-05 Thread Niklas Johansson
On 5 apr 2006, at 17.57, Michael Burke wrote: So I basically want to call get_xy for every row in sightings, and use its output for two columns; or perhaps there is another way to think of this. You could try SELECT foo.x, foo.y, title FROM (SELECT get_xy(SetSRID(sightings.location, 26

Re: [SQL] Reverse Index ... how to ...

2006-04-05 Thread Marc G. Fournier
On Wed, 5 Apr 2006, Tom Lane wrote: "Marc G. Fournier" <[EMAIL PROTECTED]> writes: I'm still searching through Google and whatnot, but not finding anything off the bat ... is there some way of creating a 'REVERSE INDEX' on a column in a table? For instance, when I do a 'CLUSTER' to sort a ta

Re: [SQL] Reverse Index ... how to ...

2006-04-05 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > I'm still searching through Google and whatnot, but not finding anything > off the bat ... is there some way of creating a 'REVERSE INDEX' on a > column in a table? > For instance, when I do a 'CLUSTER' to sort a table based on an INDEX, I'd > li

Re: [SQL] Reverse Index ... how to ...

2006-04-05 Thread Oleg Bartunov
On Wed, 5 Apr 2006, Marc G. Fournier wrote: I'm still searching through Google and whatnot, but not finding anything off the bat ... is there some way of creating a 'REVERSE INDEX' on a column in a table? For instance, when I do a 'CLUSTER' to sort a table based on an INDEX, I'd like to so

[SQL] Reverse Index ... how to ...

2006-04-05 Thread Marc G. Fournier
I'm still searching through Google and whatnot, but not finding anything off the bat ... is there some way of creating a 'REVERSE INDEX' on a column in a table? For instance, when I do a 'CLUSTER' to sort a table based on an INDEX, I'd like to sort it in reverse order, so would need the INDE

Re: [SQL] IF statement in Select

2006-04-05 Thread William Leite Araújo
You can use "Case" SELECT c1, c2, CASE WHEN c3 = 52 THEN 0 ELSE 1 END AS base_irrf_13 FROM t1;On 4/5/06, Renato Cramer < [EMAIL PROTECTED]> wrote:Hello all,Is the use of IF statement restrict to Functions and Store Procedures? I'm trying to use an IF within Select...Example:create view v1

[SQL] IF statement in Select

2006-04-05 Thread Renato Cramer
Hello all, Is the use of IF statement restrict to Functions and Store Procedures? I'm trying to use an IF within Select... Example: create view v1 as select c1, c2, if c3 = 52 then 0 else 1 endif as base_irrf_13 from t1; Thanks in advance, Renato Cramer. ---(end o

[SQL] SELECT composite type

2006-04-05 Thread Michael Burke
Hello, I have a function get_xy that returns a composite type with columns "x" and "y". I would like to SELECT these as well as some data from a table, like so: SELECT (get_xy(SetSRID(sightings.location, 26910), 4326)).x, (get_xy(SetSRID(sightings.location, 26910), 4326)).y, sightings.t

Re: [SQL] have you feel anything when you read this ?

2006-04-05 Thread Stephan Szabo
On Wed, 5 Apr 2006, Eugene E. wrote: > Stephan Szabo wrote: > > On Tue, 4 Apr 2006, Eugene E. wrote: > > > > > >>Stephan Szabo wrote: > >> > >>>On Fri, 31 Mar 2006, Eugene E. wrote: > >>> > >>> > >>> > Peter Eisentraut wrote: > > > >Eugene E. wrote: > > > > > > > >>>