Re: [GENERAL] Documentation bug?

2015-05-19 Thread Thomas Kellerer
Maxim Boguk schrieb am 19.05.2015 um 13:33:
> Hello all,
> 
> I just noticed that you can do something like this (using 9.4.1):
> 
>select array[1,2,3] - 3
> 
> which is doing the same thing as:
> 
>select array_remove(array[1,2,3],3)
> 
> but the minus is not documented as an array operator: 
> http://www.postgresql.org/docs/current/static/functions-array.html
> 
> Is that an oversight in the documentation or isn't the minus supposed to 
> work like that in the first place?
> 
> 
> ​You very likely have an intarray extension installed​:​
> http://www.postgresql.org/docs/9.4/interactive/intarray.html
> int[] - int  operator documented in the extension documentation as it's a 
> part of the extension but not part of the PostgreSQL core.​

Ah, right - that was it. Completely forgot about that.

Sorry for the noise.

Thomas




-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Documentation bug?

2015-05-19 Thread Maxim Boguk
On Tue, May 19, 2015 at 7:39 PM, Thomas Kellerer  wrote:

> Hello all,
>
> I just noticed that you can do something like this (using 9.4.1):
>
>select array[1,2,3] - 3
>
> which is doing the same thing as:
>
>select array_remove(array[1,2,3],3)
>
> but the minus is not documented as an array operator:
> http://www.postgresql.org/docs/current/static/functions-array.html
>
> Is that an oversight in the documentation or isn't the minus supposed to
> work like that in the first place?
>

​You very likely have an intarray extension installed​:​
http://www.postgresql.org/docs/9.4/interactive/intarray.html
int[] - int  operator documented in the extension documentation as it's a
part of the extension but not part of the PostgreSQL core.​



-- 
Maxim Boguk
Senior Postgresql DBA
http://www.postgresql-consulting.ru/ 

Phone RU: +7 910 405 4718
Phone AU: +61 45 218 5678

LinkedIn: http://www.linkedin.com/pub/maksym-boguk/80/b99/b1b
Skype: maxim.boguk
Jabber: maxim.bo...@gmail.com
МойКруг: http://mboguk.moikrug.ru/

"People problems are solved with people.
If people cannot solve the problem, try technology.
People will then wish they'd listened at the first stage."


Re: [GENERAL] Documentation bug?

2015-05-19 Thread Albe Laurenz
Thomas Kellerer wrote:
> I just noticed that you can do something like this (using 9.4.1):
> 
>select array[1,2,3] - 3
> 
> which is doing the same thing as:
> 
>select array_remove(array[1,2,3],3)

I can't reproduce this on my PostgreSQL 9.4.1:

test=> select array[1,2,3] - 3;
ERROR:  operator does not exist: integer[] - integer
LINE 1: select array[1,2,3] - 3;
^
HINT:  No operator matches the given name and argument type(s). You might need 
to add explicit type casts.

Did you add casts or operators?

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Documentation bug?

2015-05-19 Thread Thomas Kellerer
Hello all,

I just noticed that you can do something like this (using 9.4.1):

   select array[1,2,3] - 3

which is doing the same thing as:

   select array_remove(array[1,2,3],3)

but the minus is not documented as an array operator: 
http://www.postgresql.org/docs/current/static/functions-array.html 

Is that an oversight in the documentation or isn't the minus supposed to work 
like that in the first place?

Regards
Thomas



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] documentation bug

2014-02-27 Thread Alvaro Herrera
James Harper wrote:
> Just a minor bug in the documentation - 
> http://www.postgresql.org/docs/9.3/static/bgworker.html says that bgw_main 
> takes an argument of void*, but when declared as such gcc -Wall gives a 
> warning of:
> 
> init.c:59:19: warning: assignment from incompatible pointer type [enabled by 
> default]
>worker.bgw_main = listener;
> 
> the bgw_main should be declared as taking an argument of Datum.

Yeah, fix pushed.

-- 
Álvaro Herrerahttp://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] documentation bug

2014-02-27 Thread James Harper
Just a minor bug in the documentation - 
http://www.postgresql.org/docs/9.3/static/bgworker.html says that bgw_main 
takes an argument of void*, but when declared as such gcc -Wall gives a warning 
of:

init.c:59:19: warning: assignment from incompatible pointer type [enabled by 
default]
   worker.bgw_main = listener;

the bgw_main should be declared as taking an argument of Datum.

James


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general