Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-29 Thread Jasen Betts
On 2012-09-24, Robert James srobertja...@gmail.com wrote: I have some code which creates a function in Postgres, taken from http://wiki.postgresql.org/wiki/Array_agg . DROP AGGREGATE IF EXISTS array_agg(anyelement); CREATE AGGREGATE array_agg(anyelement) ( SFUNC=array_append,

Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-26 Thread Adrian Klaver
On 09/25/2012 08:25 AM, Daniele Varrazzo wrote: On Tue, Sep 25, 2012 at 3:47 PM, Adrian Klaver adrian.kla...@gmail.com wrote: To elaborate: test= SELECT current_setting('server_version_num'); current_setting - 90009 Yes, but knowing that, how does he run a statement only

Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-25 Thread Adrian Klaver
On 09/24/2012 06:40 PM, David Johnston wrote: Server parameter: server_version_num http://www.postgresql.org/docs/9.2/interactive/runtime-config-preset.html To elaborate: test= SELECT current_setting('server_version_num'); current_setting - 90009 And yes, I know it needs

Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-25 Thread Igor Neyman
-Original Message- From: Daniele Varrazzo [mailto:daniele.varra...@gmail.com] Sent: Tuesday, September 25, 2012 11:26 AM To: Adrian Klaver Cc: David Johnston; Robert James; Igor Neyman; Postgres General Subject: Re: [GENERAL] Running CREATE only on certain Postgres versions On Tue

[GENERAL] Running CREATE only on certain Postgres versions

2012-09-24 Thread Robert James
I have some code which creates a function in Postgres, taken from http://wiki.postgresql.org/wiki/Array_agg . DROP AGGREGATE IF EXISTS array_agg(anyelement); CREATE AGGREGATE array_agg(anyelement) ( SFUNC=array_append, STYPE=anyarray, INITCOND='{}' ); The function was added in 8.4, and so the

Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-24 Thread Daniele Varrazzo
On Mon, Sep 24, 2012 at 2:32 PM, Robert James srobertja...@gmail.com wrote: I have some code which creates a function in Postgres, taken from http://wiki.postgresql.org/wiki/Array_agg . DROP AGGREGATE IF EXISTS array_agg(anyelement); CREATE AGGREGATE array_agg(anyelement) (

Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-24 Thread Igor Neyman
-Original Message- From: Robert James [mailto:srobertja...@gmail.com] Sent: Monday, September 24, 2012 9:33 AM To: Postgres General Subject: Running CREATE only on certain Postgres versions I have some code which creates a function in Postgres, taken from http

Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-24 Thread Robert James
programatically (ie not just a long string) On 9/24/12, Igor Neyman iney...@perceptron.com wrote: -Original Message- From: Robert James [mailto:srobertja...@gmail.com] Sent: Monday, September 24, 2012 9:33 AM To: Postgres General Subject: Running CREATE only on certain Postgres versions I have

Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-24 Thread David Johnston
: -Original Message- From: Robert James [mailto:srobertja...@gmail.com] Sent: Monday, September 24, 2012 9:33 AM To: Postgres General Subject: Running CREATE only on certain Postgres versions I have some code which creates a function in Postgres, taken from http://wiki.postgresql.org/wiki