Re: [DOCS] Re: postgresql.org inconsistent (Re: [GENERAL] PG replication across DataCenters)

2013-12-15 Thread Wolfgang Keller
Instead it lists Postgres-R, which has been in koma for how long now... Can't even remember any more. Nope, it is actively developed and sponsored by Translattice. Actively developed? http://www.postgres-r.org/ lists the last entry in the column News on the right with a date of

[GENERAL] Some good news ([i...@arin.net: [arin-announce] ARIN Database Migration Completed])

2013-12-15 Thread Andrew Sullivan
I thought people'd like to know about this. For those who don't know, ARIN is the Regional Internet Registry for North America and the Carribean. That is, if you have an IP address and you are operating in that region, you depend on ARIN. Hurray! A - Forwarded message from ARIN

Re: [DOCS] Re: postgresql.org inconsistent (Re: [GENERAL] PG replication across DataCenters)

2013-12-15 Thread Christofer C. Bell
On Sun, Dec 15, 2013 at 9:40 AM, Wolfgang Keller felip...@gmx.net wrote: Instead it lists Postgres-R, which has been in koma for how long now... Can't even remember any more. Nope, it is actively developed and sponsored by Translattice. Actively developed? http://www.postgres-r.org/

[GENERAL] SELECT from record-returning function causes function code to be executed multiple times

2013-12-15 Thread dbaston
Hello, I have a simple C-language function , SimpleSRF(), that returns RECORDs with two integer columns. When I call the function using SELECT (SIMPLESRF()).*, the function code is being executed twice. I'm wondering if this is expected behavior? The function is defined as: CREATE OR REPLACE

[GENERAL] Re: SELECT from record-returning function causes function code to be executed multiple times

2013-12-15 Thread David Johnston
dbaston wrote I'm wondering if this is expected behavior? Yes. The proper way to handle this is by putting the SRF in the FROM clause. If you must have it in the select clause you should do this: WITH srf_call ( SELECT srf_function() AS srf_result ) SELECT (srf_call.srf_result).* FROM

[GENERAL] replacing expresion in plpgsql

2013-12-15 Thread Juan Pablo L
Hi, i have a function that receives a parameter which represents days: FUNCTION aaa_recharge_account(expdays integer) i want to add those days to the CURRENT_DATE, but i do not know how to do it, i have tried several ways to replace that in an expresion like: newexpdate := CURRENT_TIMESTAMP +

Re: [GENERAL] replacing expresion in plpgsql

2013-12-15 Thread Andreas Brandl
Hi, - Ursprüngliche Mail - Hi, i have a function that receives a parameter which represents days: FUNCTION aaa_recharge_account(expdays integer) i want to add those days to the CURRENT_DATE, but i do not know how to do it, i have tried several ways to replace that in an

Re: [GENERAL] replacing expresion in plpgsql

2013-12-15 Thread John R Pierce
On 12/15/2013 4:17 PM, Andreas Brandl wrote: select current_timestamp, current_timestamp + interval '2' day; that should be interval '2 day' (note the ' moved), and for a variable number passed as a parameter, try... select current_timestamp, current_timestamp + $1 * interval '1 day';

Re: [GENERAL] replacing expresion in plpgsql

2013-12-15 Thread Juan Pablo L
Hi i m working with timestamp cause i need the time too. i tried your solution and it works perfectly, it just does not adjust to my problem. thanks a lot for the answer. On 15 December 2013 18:17, Andreas Brandl m...@3.141592654.de wrote: Hi, - Ursprüngliche Mail - Hi, i have a

Re: [GENERAL] replacing expresion in plpgsql

2013-12-15 Thread Juan Pablo L
Hi, thank you very much, this worked flawlessly, this is the final code: execute 'select CURRENT_TIMESTAMP + $1 * interval ''1 day''' into newexpdate using expdays; works perfect, thanks a ton! On 15 December 2013 18:23, John R Pierce pie...@hogranch.com wrote: On 12/15/2013 4:17 PM, Andreas

Re: [GENERAL] replacing expresion in plpgsql

2013-12-15 Thread Andreas Brandl
John, - Ursprüngliche Mail - On 12/15/2013 4:17 PM, Andreas Brandl wrote: select current_timestamp, current_timestamp + interval '2' day; that should be interval '2 day' (note the ' moved), and for a variable number passed as a parameter, try... # select current_timestamp +

Re: [GENERAL] replacing expresion in plpgsql

2013-12-15 Thread Juan Pablo L
thank you very much for clarifying . On 15 December 2013 19:02, Andreas Brandl m...@3.141592654.de wrote: John, - Ursprüngliche Mail - On 12/15/2013 4:17 PM, Andreas Brandl wrote: select current_timestamp, current_timestamp + interval '2' day; that should be interval '2

Re: [GENERAL] replacing expresion in plpgsql

2013-12-15 Thread Thomas Kellerer
John R Pierce, 16.12.2013 01:23: select current_timestamp, current_timestamp + interval '2' day; that should be interval '2 day' (note the ' moved), and for a variable number passed as a parameter, try... Both are valid. interval '2' day is the ANSI SQL format though. -- Sent