Re: [GENERAL] Backup strategy using 'wal_keep_segments'

2017-10-23 Thread Rhhh Lin
Thanks very much for your reply Michael. I note that it looks like pgbarman employs pg_receivexlog; I will check it out. Regards, Ruan From: Michael Paquier Sent: 22 October 2017 22:17:01 To: Rhhh Lin Cc:

Re: [GENERAL] Two versions of an extension in the same cluster?

2017-10-23 Thread Tom Lane
Paul Jungwirth writes: > I've got an extension that supplies functions written in C. Two > databases from the same cluster both use this extension. I understand > how I can load the example--2.0.0.sql file in one database, and > example--3.0.0.sql in another, but

[GENERAL] Two versions of an extension in the same cluster?

2017-10-23 Thread Paul Jungwirth
Hello, I've got an extension that supplies functions written in C. Two databases from the same cluster both use this extension. I understand how I can load the example--2.0.0.sql file in one database, and example--3.0.0.sql in another, but from what I can tell both databases still share the

Re: [GENERAL] multiple sql results to shell

2017-10-23 Thread Randy Strauss
On Oct 23, 2017, at 08:37, pgsql-general-ow...@postgresql.org wrote: psql . | while read a; do #some code done The only problem I find with this is that you can't pass variables out of the while loop, To get input from a file w/o a sub-shell,

Re: [GENERAL] using conda environment for plpython3u?

2017-10-23 Thread John R Pierce
On 10/23/2017 2:05 PM, Celia McInnis wrote: Is it possible for users to use their conda environment for plpython, complete with the modules that they have loaded in that environment? If so, what do I do? I am running postgres 9.6.2 and would like to use a conda environment for python 3.6

[GENERAL] using conda environment for plpython3u?

2017-10-23 Thread Celia McInnis
Is it possible for users to use their conda environment for plpython, complete with the modules that they have loaded in that environment? If so, what do I do? I am running postgres 9.6.2 and would like to use a conda environment for python 3.6 which contrains a fair number of modules that I want

Re: [GENERAL] Installing PostgreSQL 10 on Mac OSX Undefined Symbol _heap_modify_tuple_by_cols

2017-10-23 Thread Tom Lane
Ben Madin writes: > we are quite excited about the parallelisation enhancements, and keen to > try, but trying to build (using the same configure as we have used for 9.6) > is giving some warnings and errors. Something's definitely messed up there: > gcc -Wall

Re: [GENERAL] table corruption

2017-10-23 Thread Peter Geoghegan
> Nice to see it included in 10! > https://www.postgresql.org/docs/10/static/amcheck.html The reason that I pointed to the Github version rather than the contrib version is that only the Github version currently has the "heapallindexed" check. That seems likely to be by far the most important

Re: [GENERAL] table corruption

2017-10-23 Thread Scott Marlowe
On Mon, Oct 23, 2017 at 9:35 AM, Peter Geoghegan wrote: > On Mon, Oct 23, 2017 at 7:44 AM, Peter Hunčár wrote: >> I know that zero_damaged_pages and vacuum (or restore the table from backup) >> will help, but I want to ask if there is a way to identify affected >>

Re: [GENERAL] Postgres 9.6 fails to start on VMWare

2017-10-23 Thread George Neuner
On Mon, 23 Oct 2017 09:14:18 +0100, Martin Moore wrote: >Same server. I tried a few times. > >I didn’t move the db separately, but did a ‘dd’ to copy the disk >to an imagefile which was converted and loaded into VMWare. If you copied the boot device that way while the

Re: [GENERAL] Postgres 9.6 fails to start on VMWare

2017-10-23 Thread Martin Moore
OK, cheers. How can I remove the db so I can restore it properly? From: Scott Mead Date: Monday, 23 October 2017 at 16:35 To: Martin Moore Cc: Michael Nolan , "pgsql-general@postgresql.org"

Re: [GENERAL] Postgres 9.6 fails to start on VMWare

2017-10-23 Thread Scott Mead
On Mon, Oct 23, 2017 at 11:26 AM, Martin Moore wrote: > It was running – not sure how dd handles this. Maybe badly… ☺ > it doesn't handle it at all. This would be the cause of your issue. --Scott > > > *From: *Michael Nolan > *Date: *Monday, 23

Re: [GENERAL] table corruption

2017-10-23 Thread Peter Geoghegan
On Mon, Oct 23, 2017 at 7:44 AM, Peter Hunčár wrote: > I know that zero_damaged_pages and vacuum (or restore the table from backup) > will help, but I want to ask if there is a way to identify affected > rows/datafiles, so we can 'fix' only the affected data using the >

Re: [GENERAL] Postgres 9.6 fails to start on VMWare

2017-10-23 Thread Martin Moore
It was running – not sure how dd handles this. Maybe badly… ☺ From: Michael Nolan Date: Monday, 23 October 2017 at 15:52 To: Martin Moore Cc: rob stone , "pgsql-general@postgresql.org" Subject:

Re: [GENERAL] Postgres 9.6 fails to start on VMWare

2017-10-23 Thread Michael Nolan
On Mon, Oct 23, 2017 at 3:14 AM, Martin Moore wrote: > Same server. I tried a few times. > > I didn’t move the db separately, but did a ‘dd’ to copy the disk to an > imagefile which was converted and loaded into VMWare. > > I ‘believed’ that this should keep the low

[GENERAL] table corruption

2017-10-23 Thread Peter Hunčár
Hi, we have a table with around 1.6 billion rows having quite lot of big binary data toasted. Today we started getting: WIB > ERROR: invalid page in block 1288868309 of relation base/96031/96201 Which is a toast reltype. I know that zero_damaged_pages and vacuum (or restore the table from

[GENERAL] Is it safe to create foreign keys beforehand when logical replication is used?

2017-10-23 Thread Önder Kalacı
Hi, I'm trying to figure out whether the following is safe or not on all conditions with logical replication: -- on the source (localhost:5432), create the tables which have foreign keys among them -- load some data and create publication CREATE TABLE rep_test (a int PRIMARY KEY); CREATE TABLE

[GENERAL] Matching statement and duration log lines

2017-10-23 Thread Popov Aleksey
Hello! I am sending PG logs to Elasticsearch and want to merge a line with statement and a line with duration into one document. Having a statement line and a duration line, can I assume that if a session ids (%c) of these lines match, and numbers of log lines (%l) are consecutive, then the

Re: [GENERAL] A question on pg_stat_subscription view

2017-10-23 Thread Önder Kalacı
Hi, Thanks for the reply, however, the documentation does not mention about that clearly. It only mentions that 'latest_end_lsn' is the `Last write-ahead log location reported to origin WAL sender`. However, what I'm particularly interested is that whether the reported log is the flushed or

Re: [GENERAL] multiple sql results to shell

2017-10-23 Thread Geoff Winkless
On 23 October 2017 at 15:08, Mark Lybarger wrote: > I have this bash/sql script which outputs some curl commands. the backticks > causes it to get interpreted by the shell. This works fine if there is one > result, but when there are many rows returned, it looks like one

Re: [GENERAL] multiple sql results to shell

2017-10-23 Thread David G. Johnston
On Mon, Oct 23, 2017 at 7:08 AM, Mark Lybarger wrote: > I have this bash/sql script which outputs some curl commands. the > backticks causes it to get interpreted by the shell. This works fine if > there is one result, but when there are many rows returned, it looks like

[GENERAL] multiple sql results to shell

2017-10-23 Thread Mark Lybarger
I have this bash/sql script which outputs some curl commands. the backticks causes it to get interpreted by the shell. This works fine if there is one result, but when there are many rows returned, it looks like one shell command. any help on getting multiple rows returned to be executed by

Re: [GENERAL] Postgres 9.6 fails to start on VMWare

2017-10-23 Thread Martin Moore
Same server. I tried a few times. I didn’t move the db separately, but did a ‘dd’ to copy the disk to an imagefile which was converted and loaded into VMWare. I ‘believed’ that this should keep the low level disk structure the same, but if this has corrupted the files I can drop, dump and

Re: [GENERAL] Alternative to pgAdmin Postgres Manager that support pgagent (jobs)

2017-10-23 Thread Juliano
Great! No worries, after work I will start with some surveys about how to package Postgres extension, and get it onto pgxn. Thanks Juliano Original Message > Subject: Re: [GENERAL] Alternative to pgAdmin Postgres Manager that support > pgagent (jobs) > Local Time: October