Re: [GENERAL] timestamps, formatting, and internals

2012-05-26 Thread Jasen Betts
On 2012-05-18, David Salisbury wrote: > So one question I have is if there a way to set PG in the way Oracle does it.. probably not. > set nls_date_format = '...' so I can query and see exactly what PG is > seeing, > even to the microseconds? set datestyle to 'ISO'; > Is there a config p

Re: [GENERAL] Not understanding this behavior of a subselect + volatile function

2012-05-26 Thread Brian Palmer
Thanks so much tom! I feel a lot better going with this fix now that I know for sure what was going wrong. -- Brian On May 26, 2012, at 8:08 PM, Tom Lane wrote: > Brian Palmer writes: >> The final line, the select, will return the row as it was before the >> function ran, (1,0) instead of (1

Re: [GENERAL] Not understanding this behavior of a subselect + volatile function

2012-05-26 Thread Tom Lane
Brian Palmer writes: > The final line, the select, will return the row as it was before the > function ran, (1,0) instead of (1,1). It's as if the outer select > locked its view of the table in place before the inner select ran. Yes, that's exactly correct. A plain SELECT always returns data th

Re: [GENERAL] Not understanding this behavior of a subselect + volatile function

2012-05-26 Thread Brian Palmer
On May 26, 2012, at 7:45 PM, Chris Angelico wrote: > I'd be inclined to treat it like C and avoid referencing and > altering a variable in one expression (eg arr[i++]=i; is a bad idea). I agree, we're already working on changing it to a two-step process where we select f1(), and then select * wh

Re: [GENERAL] Not understanding this behavior of a subselect + volatile function

2012-05-26 Thread Chris Angelico
On Sun, May 27, 2012 at 11:36 AM, Brian Palmer wrote: > That's a good link, thanks Chris. I'm not sure it entirely answers what I'm > seeing though. It does explain why the outer select doesn't see the updated > values, but the other thing that I'm seeing is that sometimes the function > will upda

Re: [GENERAL] Not understanding this behavior of a subselect + volatile function

2012-05-26 Thread Brian Palmer
On May 26, 2012, at 5:22 PM, Chris Angelico wrote: > The function is actually immaterial to this; the same thing occurs > with this single statement: > > with t1upd as (update t1 set b = b + 1 where b < 1 returning a) select > * from t1 join t1upd using (a); > > Poking around with the latter for

Re: [GENERAL] Not understanding this behavior of a subselect + volatile function

2012-05-26 Thread Chris Angelico
On Sun, May 27, 2012 at 8:17 AM, Brian Palmer wrote: > There is behavior in the following code that has me confused, and I'd like to > understand it, as it goes against how I thought that MVCC worked in psql: > ... >      select a from t1 into ret where b < 1 for update; >      update t1 set b =

[GENERAL] Not understanding this behavior of a subselect + volatile function

2012-05-26 Thread Brian Palmer
There is behavior in the following code that has me confused, and I'd like to understand it, as it goes against how I thought that MVCC worked in psql: create table t1 (a integer primary key, b integer default 0); insert into t1 (a) values (1); create function f1() returns int as

Re: [GENERAL] Forcefully adding a CHECK constrained

2012-05-26 Thread Jeff Davis
On Tue, 2012-05-15 at 12:52 +0300, Catalin(ux) M. BOIE wrote: > The old_stats is so big that I cannot afford to add a check constraint. > But, I know that all values of the itime field are before 2012_04, so, > would be great if I could run something like: > > ALTER TABLE old_stats ADD CONSTRAINT

Re: [GENERAL] configuring library path for debian build of postgres 9.2

2012-05-26 Thread Jasen Betts
On 2012-05-25, Marc Munro wrote: > $ /usr/lib/postgresql/9.2/bin/psql: symbol lookup > error: /usr/lib/postgresql/9.2/bin/psql: undefined symbol: > PQconnectdbParams At times like that I run /sbin/ldconfig Sometimes it helps. -- ⚂⚃ 100% natural -- Sent via pgsql-general mailing list (pgsq