[GENERAL] lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux

2016-08-07 Thread Alexander Farber
Hello fellow PostgreSQL users, does anybody else observe the problem, that calling lower() method on UTF8 cyrillic strings works on Mac and Linux for version 9.5.3, but fails on Windows 7 / 64 bit (I am using the unzippable version w/o installer)? I am probably not providing enough information he

Re: [GENERAL] Extract data from JSONB

2016-08-07 Thread Charles Clavadetscher
Hello > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Michael Paquier > Sent: Montag, 8. August 2016 05:24 > To: Alex Magnum > Cc: Postgres General > Subject: Re: [GENERAL] Extract data from JSONB > > On Mon, Au

Re: [GENERAL] Extract data from JSONB

2016-08-07 Thread Michael Paquier
On Mon, Aug 8, 2016 at 12:08 PM, Alex Magnum wrote: > How can I convert that into one row each based on status; for example if I > only want to have the active modules. You can use jsonb_each to decompose that: =# select key, (value::json)->'status' from jsonb_each('{

[GENERAL] Extract data from JSONB

2016-08-07 Thread Alex Magnum
Hi, I need some help with extracting data from json. I have the following jsonb field modules { "accounts": {"status": true}, "admin":{"status": true}, "calendar": {"status": false}, "chat": {"status": true}, "contacts": {"status": true}, "dashboard":

Re: [GENERAL] how to serialize insert followed by read(select) by different clients

2016-08-07 Thread Sandeep Gupta
Hi Tom, Appreciate so much for looking into this. This is a single database instance. I debugged a bit more after I posted the problem and realized that writer was actually working in asynchronous mode. Once I fixed that the program is working as expected. Thanks. sandeep On Sun, Aug 7, 20

Re: [GENERAL] fixing failed master after standby promotion

2016-08-07 Thread Michael Paquier
On Mon, Aug 8, 2016 at 11:35 AM, Masahiko Sawada wrote: > On Sun, Aug 7, 2016 at 10:55 PM, Aviel Buskila wrote: >> Hey , >> I have been setting a configuration of 2 nodes (master and standby) >> replicating using repmgr, and 1 server using for load balancing using >> pgpool-II. >> Now after the m

Re: [GENERAL] fixing failed master after standby promotion

2016-08-07 Thread Masahiko Sawada
On Sun, Aug 7, 2016 at 10:55 PM, Aviel Buskila wrote: > Hey , > I have been setting a configuration of 2 nodes (master and standby) > replicating using repmgr, and 1 server using for load balancing using > pgpool-II. > Now after the master has failed, the standby was successfully promoted. > I wou

Re: [GENERAL] pg_archivecleanup standalone bash script

2016-08-07 Thread Patrick B
*recovery.conf:* archive_cleanup_command = 'exec /var/lib/pgsql/bin/pg_archivecleaup_mv.bash' *Final pg_archivecleanup script:* #!/bin/bash declare -r -x PATH='/usr/local/bin:/usr/bin:/bin'; ARCHIVEDIR='/var/lib/pgsql/archive' LAST_BACKUP=$(ls -lto ${ARCHIVEDIR}) cd $ARCHIVEDIRexec "/usr/pgsql

Re: [GENERAL] Should a DB vacuum use up a lot of space ?

2016-08-07 Thread Adrian Klaver
On 08/07/2016 02:55 PM, Philippe Girolami wrote: That is expected as template0 is read-only and so VACUUM will not work on it. Isn’t template1 the same ? I’m not seeing that behavior on that one Should I suspect something fishy going on ? Not sure without more information. 1) Can you

Re: [GENERAL] Should a DB vacuum use up a lot of space ?

2016-08-07 Thread Philippe Girolami
>That is expected as template0 is read-only and so VACUUM will not work >on it. Isn’t template1 the same ? I’m not seeing that behavior on that one >> Should I suspect something fishy going on ? >Not sure without more information. >1) Can you be specific about your database refer

Re: [GENERAL] Retrieving value of column X days later

2016-08-07 Thread Tim Smith
Thank you Victor Will experiment with this over the next couple of days. On 7 August 2016 at 21:41, Victor Yegorov wrote: > 2016-08-07 22:23 GMT+03:00 Tim Smith : >> >> create table test ( >> when date, >> foo numeric, >> bar numeric, >> alice numeric, >> bob numeric); >> >> insert into test val

Re: [GENERAL] Retrieving value of column X days later

2016-08-07 Thread Tim Smith
Thank you Sándor. Will experiment with this over the next couple of days. On 7 August 2016 at 21:05, Sándor Daku wrote: > On 7 August 2016 at 21:23, Tim Smith wrote: >> >> Hi, >> >> Let's say I've got a table : >> >> create table test ( >> when date, >> foo numeric, >> bar numeric, >> alice num

Re: [GENERAL] Retrieving value of column X days later

2016-08-07 Thread Victor Yegorov
2016-08-07 22:23 GMT+03:00 Tim Smith : > create table test ( > when date, > foo numeric, > bar numeric, > alice numeric, > bob numeric); > > insert into test values ('2016-01-01',1,2,3,4); > insert into test values ('2016-01-02',5,6,7,8); > insert into test values ('2016-01-03',9,10,11,12); > inse

Re: [GENERAL] Retrieving value of column X days later

2016-08-07 Thread Sándor Daku
On 7 August 2016 at 21:23, Tim Smith wrote: > Hi, > > Let's say I've got a table : > > create table test ( > when date, > foo numeric, > bar numeric, > alice numeric, > bob numeric); > > insert into test values ('2016-01-01',1,2,3,4); > insert into test values ('2016-01-02',5,6,7,8); > insert int

[GENERAL] Retrieving value of column X days later

2016-08-07 Thread Tim Smith
Hi, Let's say I've got a table : create table test ( when date, foo numeric, bar numeric, alice numeric, bob numeric); insert into test values ('2016-01-01',1,2,3,4); insert into test values ('2016-01-02',5,6,7,8); insert into test values ('2016-01-03',9,10,11,12); insert into test values ('2016

Re: [GENERAL] Should a DB vacuum use up a lot of space ?

2016-08-07 Thread Adrian Klaver
On 08/07/2016 10:26 AM, Philippe Girolami wrote: I am seeing something weird though (again, this is v9.1): after my database became usable again, I started getting the 10M warning on template0. So I made it connectable and ran VACUUM FREEZE on it and made it unconnectable again. That resolve th

Re: [GENERAL] Should a DB vacuum use up a lot of space ?

2016-08-07 Thread John R Pierce
On 8/7/2016 10:26 AM, Philippe Girolami wrote: More weirdness this afternoon : the wraparound ERROR showed up again even though I have trouble believing I burned through so many transactions in under a day. But let’s assume I did, here is what I noticed 1) I vacuumed all other databases. For e

Re: [GENERAL] Should a DB vacuum use up a lot of space ?

2016-08-07 Thread Philippe Girolami
>> I am seeing something weird though (again, this is v9.1): after my database >> became usable again, I started getting the 10M warning on template0. So I >> made it connectable and ran VACUUM >>FREEZE on it and made it unconnectable again. That resolve the warning. >> >> However, I see the “ag

Re: [GENERAL] how to serialize insert followed by read(select) by different clients

2016-08-07 Thread Tom Lane
Sandeep Gupta writes: > First program, lets say the writer, (using psql) appends to a table > in the database. > Second program, the reader, (python using alchemy) reads the data. > This happens in loop, one for each day.The programs are fired in that order > and the first program always comm

Re: [GENERAL] Should a DB vacuum use up a lot of space ?

2016-08-07 Thread Adrian Klaver
On 08/07/2016 12:32 AM, Philippe Girolami wrote: @Adrian, no problem ! I’m sure someone else will run into this and have the same questions, hopefully they’ll find the answers. I am seeing something weird though (again, this is v9.1): after my database became usable again, I started getting th

[GENERAL] Re: [GENERAL] ФС против Постгреса для файлов

2016-08-07 Thread Victor Yegorov
7 августа 2016 г., 11:39 пользователь Михаил написал: > Есть типовая задача. Для сущностей БД хранить наборы файлов. Не столь > мало - всего от миллионов на данный момент плюс большой рост на > перспективу, и небольшие, не более 1 Гб, чаще размером десятки-сотни > Кб. > > Ранее такую задачу реали

[GENERAL] fixing failed master after standby promotion

2016-08-07 Thread Aviel Buskila
Hey , I have been setting a configuration of 2 nodes (master and standby) replicating using repmgr, and 1 server using for load balancing using pgpool-II. Now after the master has failed, the standby was successfully promoted. I would like to know if there is any elegant way to semi-automatically r

Re: [GENERAL] Logical Decoding Failover

2016-08-07 Thread Colin Morelli
Venkata, Thanks for the reply. Unfortunately something like PgPool still won't create the replication slots on all hosts, and record the LSN in a way that is reusable on the secondary. This sort of puts logical decoding at odds with HA, correct? In the case of master failover, there's no way to:

[GENERAL] ФС против Постгреса для файлов

2016-08-07 Thread Михаил
Доброго! Есть типовая задача. Для сущностей БД хранить наборы файлов. Не столь мало - всего от миллионов на данный момент плюс большой рост на перспективу, и небольшие, не более 1 Гб, чаще размером десятки-сотни Кб. Ранее такую задачу реализовывал в виде двух-трех уровневых каталогов с именами-ИД

Re: [GENERAL] Streaming Replica Master-Salve Config.

2016-08-07 Thread Eduardo Morras
On Fri, 5 Aug 2016 12:43:43 -0700 John R Pierce wrote: > On 8/4/2016 9:15 AM, Eduardo Morras wrote: > > If you set max_connections too high, those connections will > > compete/figth for same resources, CPU processing, I/O to disks, > > Memory and caches, Locks, and postgres will spend more time >

Re: [GENERAL] Updated RUM-index and support for bigint as part of index

2016-08-07 Thread Andreas Joseph Krogh
På søndag 07. august 2016 kl. 08:27:06, skrev Oleg Bartunov mailto:obartu...@gmail.com>>: [snip] have you considered <=| and |=> operators ? <=> in ORDER BY works like KNN.   I don't get how these operators should work. Neither give me the expected results.   Using <=>   SELECT del.entity_id, d

Re: [GENERAL] Should a DB vacuum use up a lot of space ?

2016-08-07 Thread Philippe Girolami
@Adrian, no problem ! I’m sure someone else will run into this and have the same questions, hopefully they’ll find the answers. I am seeing something weird though (again, this is v9.1): after my database became usable again, I started getting the 10M warning on template0. So I made it connectab