How would you rewrite something like:
WHERE (COALESCE(b.quantity, 0) - COALESCE(b.deliveredsum, 0)) > 0;
I could write:
where case when b.quantity is null then 0 else b.quantity end - case when
b.deliveredsum is null then 0 else b.deliveredsum end > 0
It is butt ugly, but is that the most effi
Actually I just checked and the plan is exactly the same for those 2 clauses.
Original Message
Subject: Re:8.2.4 serious slowdown
From: Sim Zacks <[EMAIL PROTECTED]>
To:
Date: Sunday, January 13, 2008 07:59:22 AM
> How would you rewrite something like:
> WHERE (COALESCE(b.
On Jan 12, 2008 11:26 PM, Sergei Shelukhin <[EMAIL PROTECTED]> wrote:
> Hmmm. What if there's more than one table? Is "from x,y" a viable option?
UPDATE table1 t1
SET blah = 1
FROM (
SELECT t2.t1id
FROM table2 t2
JOIN table3 t3
ON t2.id = t3.t2id
) foobar
WHERE t1.id = foobar.t1id
It's al
On Jan 13, 2008 12:05 AM, I said
> It's all in the docs:
> http://www.postgresql.org/docs/8.2/static/sql-update.html
To clarify, you can use the direct form, without using a subselect:
UPDATE table1 t1
SET blah = 1
FROM table2 t2
JOIN table3 t3
ON t2.id = t3.t2id
WHERE t1.id = t2.t1id
Lookup
Hi All,
We were trying to move a big database from one machine to the other
using PITR mechanism. We hit the following LOG message in during the
recovery (WAL replay) process"
LOG: incorrect resource manager data checksum in record at 111/A7738C8
I had used this procedure to do such mig
Rodrigo E. De León Plicet wrote:
On Jan 12, 2008 5:22 PM, Sergei Shelukhin <[EMAIL PROTECTED]> wrote:
Hi.
I was wondering if I could do something similar to this in Postgres and
if yes how?
UPDATE table1 SET blah = 1 FROM table1
INNER JOIN table2 ON table1.id = table2.t1id
UPDATE
On Jan 12, 2008 5:22 PM, Sergei Shelukhin <[EMAIL PROTECTED]> wrote:
> Hi.
>
> I was wondering if I could do something similar to this in Postgres and
> if yes how?
>
> UPDATE table1 SET blah = 1 FROM table1
> INNER JOIN table2 ON table1.id = table2.t1id
UPDATE table1 t1
SET blah = 1
FROM tabl
Kris Jurka <[EMAIL PROTECTED]> writes:
> On Thu, 10 Jan 2008, [EMAIL PROTECTED] wrote:
>> What do you mean with "longer lifespan"? Doesn't the JDBC driver uses the
>> PREPARE Sql Statement and therefore the prepared Statement has the same
>> lifespan as the connection? If so, as connections are poo
"Lawrence Oluyede" <[EMAIL PROTECTED]> writes:
> Here it is:
> postgres$ gdb /usr/local/pgsql/bin/postgres core.1600
> (gdb) bt
> #0 0x082c101c in pfree (pointer=0x8472f00) at mcxt.c:591
> #1 0xb7e46513 in xmlCleanupCharEncodingHandlers () from /usr/lib/libxml2.so.2
> #2 0xb7e4f091 in xmlCleanup
"Matt Magoffin" <[EMAIL PROTECTED]> writes:
> Hello, I'm using 8.3b4 and keep experiencing server crash when I execute
> various queries using XML functions.
Please see if it's better with 8.3RC1 plus this patch:
http://archives.postgresql.org/pgsql-committers/2008-01/msg00190.php
Hi.
I was wondering if I could do something similar to this in Postgres and
if yes how?
UPDATE table1 SET blah = 1 FROM table1
INNER JOIN table2 ON table1.id = table2.t1id
If not, is there any way to make UPDATE ... WHERE id IN () use indexes?
---(end of br
On Thu, 10 Jan 2008, [EMAIL PROTECTED] wrote:
ah! So it doesn't help if it's the same statement, it has to be the same
object! So DBCP has a statement pool like a map, say
Map
so it can fetch the reference to already existing prepared Statement by
looking at the statement itself, right?
Exac
On 1/12/08, alphax <[EMAIL PROTECTED]> wrote:
> Thanks. Actually, I want to compares the system columns(xmin, xmax,
> ctid) with the tid returned by txid functions declared in
>
> http://developer.postgresql.org/pgdocs/postgres/functions-info.html#FUNCTIONS-TXID-SNAPSHOT
>
>
> I want to determines
danilo.juvinao napisal 2008-01-12 01:18:
Hello,
i want know how can i get the schema name that execute a trigger.
for example, if a have a schema "myschema" and a table "mytable" and
it have a trigger procedure, i want know inside the trigger procedure,
with plpgsql, the shcema name "myschema".
In article <[EMAIL PROTECTED]>,
Erik Jones <[EMAIL PROTECTED]> wrote:
>I'd suggest getting a different book that gives examples in
>Postgres or, failing that, read the Postgres manual and learn
>how to translate them yourself.
I found O'Reilly's SQL Cookbo
Zelinskiy Alexander <[EMAIL PROTECTED]> writes:
> I understand that this description can't give you enough information
> to give an advice what to do. But I don't know what to collect from OS/
> PG when it will happen again. Could you give me an advice what should
> I do when next time one of
Hello, all.
I have a Postgresql 8.2.5 running on gentoo linux on sun fire v240
server with storage 3310. And sometimes I have a problem: time to time
one postgres process starts using all CPU time. I can't kill this
process. I can't stop postgres. I can't shutdown server at all from
OS, o
"henry" <[EMAIL PROTECTED]> writes:
> I have tried setting tcp_keepalives_idle = 120 (eg), then restarting PG,
> but SHOW ALL; shows tcp_keepalives_idle=0 (ignoring my setting).
Just FYI, this is the expected behavior on platforms where the kernel
doesn't allow adjustment of the TCP keepalive para
On Sat, January 12, 2008 1:20 pm, Gregory Stark wrote:
> "henry" <[EMAIL PROTECTED]> writes:
>
>> tcp_keepalives_interval and tcp_keepalives_count I have left on default.
>> After a few hours worth of running, theres a few thousand idle postgres
>> procs, and they're all idle...
>
> Are you sure th
> We have a very busy setup using multiple clusters, slony, etc. My problem
> relates to the number of postgres procs increasing, and not decreasing
> when idle. I eventually end up with thousands of idle processes listening
> on /tmp/.s.PGSQL.5432 and not quitting (eventually bumping into
> max_
"henry" <[EMAIL PROTECTED]> writes:
> tcp_keepalives_interval and tcp_keepalives_count I have left on default.
> After a few hours worth of running, theres a few thousand idle postgres
> procs, and they're all idle...
Are you sure the clients are actually gone? tcp keepalives are only going to
h
Hello all,
PG: 8.2.4
We have a very busy setup using multiple clusters, slony, etc. My problem
relates to the number of postgres procs increasing, and not decreasing
when idle. I eventually end up with thousands of idle processes listening
on /tmp/.s.PGSQL.5432 and not quitting (eventually bum
22 matches
Mail list logo