Re: [GENERAL] [Off Topic] Visualizing grouping sets/cubes

2017-02-11 Thread Adrian Klaver
On 02/10/2017 05:44 AM, Leonardo M. Ramé wrote: Hi, I'm reading about Grouping Sets/Rollup/Cube and I wonder which js/html5 library allows displaying *easily* (without having to re-format it) the returned data from those functions. Just ran across the below, not sure if it meets your needs: ht

Re: [GENERAL] intentional or oversight? pg_dump -c does not restore default priviliges on schema public

2017-02-11 Thread Adrian Klaver
On 02/11/2017 02:06 PM, Stephen Frost wrote: Greetings, * Frank van Vugt (ftm.van.v...@foxi.nl) wrote: I noticed the following and wondered whether this is intentional or an oversight in pg_dump's '-c' option? The clean option causes the public schema to be dropped and recreated, but this is d

Re: [GENERAL] intentional or oversight? pg_dump -c does not restore default priviliges on schema public

2017-02-11 Thread Tom Lane
Stephen Frost writes: > I'm not seeing a very simple answer for this, unfortunately. I'm inclined to argue that it was a mistake to include any non-pinned objects in pg_init_privs. The reason initdb leaves some objects unpinned is exactly because they can be dropped and recreated, and that means

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-11 Thread Jan de Visser
On Friday, February 10, 2017 6:46:08 PM EST David G. Johnston wrote: > In short - this is the wrong list (pgsql-j...@postgresql.org is the > appropriate one; or the official GitHub repo) and you need to provide some > working self-contained examples showing exactly what you are doing.​​ > > On Fri

Re: [GENERAL] intentional or oversight? pg_dump -c does not restore default priviliges on schema public

2017-02-11 Thread Stephen Frost
Greetings, * Frank van Vugt (ftm.van.v...@foxi.nl) wrote: > I noticed the following and wondered whether this is intentional or an > oversight in pg_dump's '-c' option? > > The clean option causes the public schema to be dropped and recreated, but > this is done with the default schema privilig

Re: [GENERAL] intentional or oversight? pg_dump -c does not restore default priviliges on schema public

2017-02-11 Thread Frank van Vugt
Hi Adrian, Op zaterdag 11 februari 2017 13:31:17 schreef Adrian Klaver: > I see the same thing now. Glad you do ;) > That seems to cause a problem Yeah, I originally ran into this when I noticed that on a restored db a regular user lost access to tables created by him in the public schema. G

Re: [GENERAL] intentional or oversight? pg_dump -c does not restore default priviliges on schema public

2017-02-11 Thread Adrian Klaver
On 02/11/2017 01:14 PM, Frank van Vugt wrote: Hi Adrian, Op zaterdag 11 februari 2017 13:02:29 schreef Adrian Klaver: What version of Postgres? Ah, sorry, missed copying that in: postgres=# select version(); version -

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Tom Lane
Alexander Farber writes: > after switching to 9.6.2 from 9.5.3 the following custom function has > stopped working: > CREATE OR REPLACE FUNCTION words_shuffle(in_array varchar[]) > RETURNS varchar[] AS > $func$ > SELECT array_agg(letters.x) FROM > (SELECT UNNEST(in_array)

Re: [GENERAL] intentional or oversight? pg_dump -c does not restore default priviliges on schema public

2017-02-11 Thread Frank van Vugt
Hi Adrian, Op zaterdag 11 februari 2017 13:02:29 schreef Adrian Klaver: > What version of Postgres? Ah, sorry, missed copying that in: postgres=# select version(); version -

Re: [GENERAL] intentional or oversight? pg_dump -c does not restore default priviliges on schema public

2017-02-11 Thread Adrian Klaver
On 02/11/2017 12:42 PM, Frank van Vugt wrote: > L.S. > > I noticed the following and wondered whether this is intentional or an > oversight in pg_dump's '-c' option? What version of Postgres? Because when I do it on 9.5.5 I get: test=# create database publictest;

[GENERAL] intentional or oversight? pg_dump -c does not restore default priviliges on schema public

2017-02-11 Thread Frank van Vugt
L.S. I noticed the following and wondered whether this is intentional or an oversight in pg_dump's '-c' option? The clean option causes the public schema to be dropped and recreated, but this is done with the default schema priviliges, which are not the same as the ones assigned during create

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Pavel Stehule
2017-02-11 19:51 GMT+01:00 Alexander Farber : > At the same time this advice from > http://stackoverflow.com/questions/42179012/how-to- > shuffle-array-in-postgresql-9-6-and-also-lower-versions > works, don't know why though: > > words=> select array_agg(u order by random()) > words-> from unnest(

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Adrian Klaver
On 02/11/2017 10:51 AM, Alexander Farber wrote: At the same time this advice from http://stackoverflow.com/questions/42179012/how-to-shuffle-array-in-postgresql-9-6-and-also-lower-versions works, don't know why though: words=> select array_agg(u order by random()) words-> from unnest(array['a','

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Alexander Farber
At the same time this advice from http://stackoverflow.com/questions/42179012/how-to-shuffle-array-in-postgresql-9-6-and-also-lower-versions works, don't know why though: words=> select array_agg(u order by random()) words-> from unnest(array['a','b','c','d','e','f']) u; array_agg -

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Alexander Farber
words=> select version(); version -- PostgreSQL 9.6.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit (1

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Jack Christensen
On 02/11/2017 11:36 AM, Adrian Klaver wrote: On 02/11/2017 09:17 AM, Alexander Farber wrote: I think ORDER BY RANDOM() has stopped working in 9.6.2: words=> select unnest(ARRAY['a','b','c','d','e','f']) order by random(); unnest a b c d e f (6 rows) postgres=> select ve

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Adrian Klaver
On 02/11/2017 09:17 AM, Alexander Farber wrote: I think ORDER BY RANDOM() has stopped working in 9.6.2: words=> select unnest(ARRAY['a','b','c','d','e','f']) order by random(); unnest a b c d e f (6 rows) So back to your original question: CREATE OR REPLACE FUNCTION public.wo

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Adrian Klaver
On 02/11/2017 09:17 AM, Alexander Farber wrote: > I think ORDER BY RANDOM() has stopped working in 9.6.2: > > words=> select unnest(ARRAY['a','b','c','d','e','f']) order by random(); > unnest > > a > b > c > d > e > f > (6 rows) > postgres=> select version();

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Melvin Davidson
I don't use an array, but perhaps you can adapt to this function which works in 9.6.1 CREATE OR REPLACE FUNCTION public.scramble(text) RETURNS text AS $BODY$ DECLARE p_inALIAS FOR $1; v_outTEXT DEFAULT ''; v_modTEXT; v_lenINT4; v_ctrINT4; v_posINT4

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Alexander Farber
I think ORDER BY RANDOM() has stopped working in 9.6.2: words=> select unnest(ARRAY['a','b','c','d','e','f']) order by random(); unnest a b c d e f (6 rows)

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Pavel Stehule
Hi 2017-02-11 17:37 GMT+01:00 Alexander Farber : > Good evening, > > after switching to 9.6.2 from 9.5.3 the following custom function has > stopped working: > > CREATE OR REPLACE FUNCTION words_shuffle(in_array varchar[]) > RETURNS varchar[] AS > $func$ > SELECT array_agg(letters

[GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Alexander Farber
Good evening, after switching to 9.6.2 from 9.5.3 the following custom function has stopped working: CREATE OR REPLACE FUNCTION words_shuffle(in_array varchar[]) RETURNS varchar[] AS $func$ SELECT array_agg(letters.x) FROM (SELECT UNNEST(in_array) x ORDER BY RANDOM()) lett

Re: [GENERAL] BDR problem rejoining node

2017-02-11 Thread Sylvain Marechal
2017-02-11 1:34 GMT+01:00 Tanner Kerr : > I have two databases being replicated across three nodes with bdr. The > third node filled up and crashed. I removed this node from the group > successfully, but now I'm having trouble rejoining it. I'm able to re-join > the one database no problem. Howeve