Re: [SQL] What's ETA for read/write Views?

2000-08-04 Thread Peter Eisentraut
Tom Lane writes: > Some people seem to think that the system should try to intuit > those rules for them, but I don't believe that's either possible > or desirable. The entire point of a view is that it's not an > exact image of the underlying data, so how is a machine going to > figure out what

[SQL] Database in recovery mode

2000-08-04 Thread Michael Richards
Hi. I've got a postgres system that keeps going into recovery mode. I can't really find any docs on this. All of the postgres processes will be in the STOP state and when I try to connect it will say "The database is in recovery mode". I suspect there is a query that is causing it to crash in

Re: [SQL] Extracting data by months

2000-08-04 Thread Karel Zak
On Fri, 4 Aug 2000, Sandis wrote: > I do it like this: > > SELECT datums FROM jaunumi > WHERE date_part('year',datetime(datums)) = '2000' AND > date_part('month',datetime(datums)) = '08'; > > Where datums is a timestamp field. Or (in 7.0): SELECT datums FROM jaunum WHERE to_c

Re: [SQL] Extracting data by months

2000-08-04 Thread Daniel Kalchev
This is not exactly what the original question was about. You select the month is one specific year only. What you do it however easier achieved by: SELECT datums FROM jaunumi WHERE date_trunc('month', datums) = '2000-08-01'; datetime is an type full of tricks. :-) Daniel >>>"Sandis" said:

RE: [SQL] SQL (table transposition)

2000-08-04 Thread Henry Lafleur
Hi, When I saw cross tab, I realized that I'd done this before. If you know what your keys are ahead of time, you can write the query. Otherwise, you can write a program go generate the query by looking at the distinct list of keys and generating code as follows. The code generator would only h

Re: [SQL] A question about indexes...

2000-08-04 Thread Alexaki Sofia
Hello, I have the following tables in my database Painter(id integer, uri varchar(256)) paints(id1 integer, id2 integer) in order to speed up the join (select * from painter, paints where painter.id= paints.id1) between these two tables I have created indexes on the field painter.id and/or pa

[SQL] Strange strategy with COALESCE?

2000-08-04 Thread Philip Warner
I get unexpected query strategy when using coalesce. Good: - explain update zzz set b = (select x.newVal from zzz_xref x where x.oldVal = zzz.b); NOTICE: QUERY PLAN: Seq Scan on zzz (cost=0.00..20.00 rows=1000 width=10) SubPlan -> Index Scan using zzz_xref_ix2 on zzz_xref

Re: [SQL] Extracting data by months

2000-08-04 Thread Sandis
I do it like this: SELECT datums FROM jaunumi WHERE date_part('year',datetime(datums)) = '2000' AND date_part('month',datetime(datums)) = '08'; Where datums is a timestamp field. Regards, Sandis Jerics www.mediaparks.lv > This might seem rather silly, but could you simply do some

Re: [SQL] SQL (table transposition)

2000-08-04 Thread Volker Paul
[EMAIL PROTECTED] wrote: > > Is there any way to get table T3 (below) from T1 and T2 using SQL (select, view, >etc)? > > T3 is basically all INDEX values from T1 matched to IND from T2 with the >corresponding KEY/VALUE pairs transposed from rows to columns. > > --- > |INDEX| (T1) >