[GENERAL] Trigger.. AFTER and BEFORE with specific column changed

2012-04-01 Thread Albert
*I'm trying to follow this :* CREATE TRIGGER check_update *BEFORE* UPDATE ON accounts FOR EACH ROW WHEN (OLD.balance IS DISTINCT FROM NEW.balance) EXECUTE PROCEDURE check_account_update(); *but with AFTER instead of BEFORE. and I'm keep getting error on or near WHEN. does that be

[GENERAL] Parameter setting in multi-statement command; I got bit today

2012-04-01 Thread Jerry Sievers
Just FYI... maybe I'm the only Pg veteran who didn't know this but; Parameter settings in a multi-statement command are not in effect for later statements in same command. They will take effect on later commands however as seen below. The 2 seconds statement timeout does nothing to prevent the s

Re: [GENERAL] Trigger.. AFTER and BEFORE with specific column changed

2012-04-01 Thread Adrian Klaver
On 04/01/2012 11:45 AM, Albert wrote: *I'm trying to follow this :* CREATE TRIGGER check_update *BEFORE* UPDATE ON accounts FOR EACH ROW WHEN (OLD.balance IS DISTINCT FROM NEW.balance) EXECUTE PROCEDURE check_account_update(); *but with AFTER instead of BEFORE. and I'm keep

Re: [GENERAL] Parameter setting in multi-statement command; I got bit today

2012-04-01 Thread Tom Lane
Jerry Sievers writes: > Just FYI... maybe I'm the only Pg veteran who didn't know this but; > Parameter settings in a multi-statement command are not in effect for > later statements in same command. This is not a true statement in general. > They will take effect on later > commands however as

Re: [GENERAL] Parameter setting in multi-statement command; I got bit today

2012-04-01 Thread Jerry Sievers
Tom Lane writes: > Jerry Sievers writes: > >> Just FYI... maybe I'm the only Pg veteran who didn't know this but; >> Parameter settings in a multi-statement command are not in effect for >> later statements in same command. > > This is not a true statement in general. > >> They will take effect

[GENERAL] Versioned, chunked documents

2012-04-01 Thread Ivan Voras
Hi, I have documents which are divided into chunks, so that the (ordered) concatenation of chunks make the whole document. Each of the chunks may be edited separately and past versions of the chunks need to be kept. The structure looks fairly simple: CREATE TABLE documents ( id SERIAL PRIMAR

Re: [GENERAL] Versioned, chunked documents

2012-04-01 Thread Ondrej Ivanič
Hi, On 2 April 2012 08:38, Ivan Voras wrote: > db=> set enable_seqscan to off; > > This huge cost of 100 which appeared out of nowhere in the > EXPLAIN output and the seq scan worry me - where did that come from? It is not possible to disable seq scan completely. The "enable_seqscan

Re: [GENERAL] Versioned, chunked documents

2012-04-01 Thread Ivan Voras
2012/4/2 Ondrej Ivanič : > Hi, > > On 2 April 2012 08:38, Ivan Voras wrote: >> db=> set enable_seqscan to off; > > > >> >> This huge cost of 100 which appeared out of nowhere in the >> EXPLAIN output and the seq scan worry me - where did that come from? > > It is not possible to disable s

Re: [GENERAL] Versioned, chunked documents

2012-04-01 Thread Martin Gregorie
On Mon, 2012-04-02 at 00:38 +0200, Ivan Voras wrote: > Hi, > > I have documents which are divided into chunks, so that the (ordered) > concatenation of chunks make the whole document. Each of the chunks may > be edited separately and past versions of the chunks need to be kept. > > The structure

Re: [GENERAL] Versioned, chunked documents

2012-04-01 Thread Martin Gregorie
Correction interpolated - see below On Mon, 2012-04-02 at 00:22 +0100, Martin Gregorie wrote: > On Mon, 2012-04-02 at 00:38 +0200, Ivan Voras wrote: > > Hi, > > > > I have documents which are divided into chunks, so that the (ordered) > > concatenation of chunks make the whole document. Each of t

Re: [GENERAL] Trigger.. AFTER and BEFORE with specific column changed

2012-04-01 Thread Albert
*i get:* Syntax error at or near 'WHEN' LINE 1: ... check_update AFTER UPDATE ON accounts FOR EACH ROW WHEN (OLD.balance IS DISTINCT FROM NEW.balance) -- View this message in context: http://postgresql.1045698.n5.nabble.com/Trigger-AFTER-and-BEFORE-with-specific-column-changed-tp5610712p561