query_to_xml() returns invalid XML when query returns no rows

2018-03-12 Thread Thomas Kellerer
I am not sure if this qualifies as a bug: query_to_xml() returns an empty XML document when the query returns no rows, e.g: select query_to_xml('select 42 where false', false, true, ''); The problem with this is, that if the resulting XML is then fed into e.g. the xpath() function, that fu

can someone send a design document of "parallel work" to me?

2018-03-12 Thread lin
Hi, all, I hava read the code for "parallel work" of PostgreSQL 9.6, I hope someone can give me a design document of "parallel work". Thanks, Lin

Re: can someone send a design document of "parallel work" to me?

2018-03-12 Thread Adrian Klaver
On 03/12/2018 02:59 AM, lin wrote: Hi, all,      I hava read the code for "parallel work" of PostgreSQL 9.6,  I hope someone can give me a  design document of "parallel work". In search of clarity: 1) When you say parallel work are you talking about the parallel query features or something

psql in a bash function

2018-03-12 Thread Ron Johnson
Hi, Because I need to log into many servers, I created functions as keyboard shortcuts (not aliases, since I will want to embed these shortcuts in other functions). psqlxyz () {     echo "P1=$1";     echo "P2=$2";     psql -U postgres -h XYZ $@ } This is the (simple, test) command that I wan

Re: psql in a bash function

2018-03-12 Thread Melvin Davidson
On Mon, Mar 12, 2018 at 2:14 PM, Ron Johnson wrote: > Hi, > > Because I need to log into many servers, I created functions as keyboard > shortcuts (not aliases, since I will want to embed these shortcuts in other > functions). > > psqlxyz () > { > echo "P1=$1"; > echo "P2=$2"; > psql

Re: psql in a bash function

2018-03-12 Thread Eric Raskin
Yes, you need double quotes around $@, as in "$@". https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html Sent from my Verizon, Samsung Galaxy smartphone Original message From: Ron Johnson Date: 3/12/18 2:15 PM (GMT-05:00) To: pgsql-general Subject:

Re: psql in a bash function

2018-03-12 Thread Ron Johnson
I knew it was something simple... Thanks On 03/12/2018 01:24 PM, Eric Raskin wrote: Yes, you need double quotes around $@, as in "$@". https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html Sent from my Verizon, Samsung Galaxy smartphone Original message --

pglogical lag due to replication timeout

2018-03-12 Thread greigwise
Hello all. I've recently configured logical replication on postgres 9.6.5 using pglogical 2.1.1. The problem I'm seeing is pretty constant stream of these errors on the service side in the postgres logs: LOG: terminating walsender process due to replication timeout After so many of these, I ca

Logical decoding on standby

2018-03-12 Thread Andreas Joseph Krogh
Anybody knows if $subject will make it into v11?   -- Andreas Joseph Krogh

Reindex doesn't eliminate bloat

2018-03-12 Thread Ron Johnson
v8.4.12 According to this (https://pastebin.com/TJB32n5M) query, which I thought I got from https://wiki.postgresql.org/wiki/Index_Maintenance, a list of indexes and their bloat is generated. After reindexing a table with a large amount of reported bloat (column bloat_pct says 29%), re-runni

Re: Reindex doesn't eliminate bloat

2018-03-12 Thread Nikolay Samokhvalov
On Tue, Mar 13, 2018 at 1:05 AM, Ron Johnson wrote: > v8.4.12 > This is *very* old version, not supported by the community for many years. Check https://www.postgresql.org/ to see currently supported versions. You need to upgrade it.

Re: Reindex doesn't eliminate bloat

2018-03-12 Thread Ron Johnson
On 03/12/2018 05:20 PM, Nikolay Samokhvalov wrote: On Tue, Mar 13, 2018 at 1:05 AM, Ron Johnson > wrote: v8.4.12 This is *very* old version, not supported by the community for many years. Check https://www.postgresql.org/ to seecurrentlysupported versions. Yo

Re: query_to_xml() returns invalid XML when query returns no rows

2018-03-12 Thread Peter Eisentraut
On 3/12/18 08:18, Thomas Kellerer wrote: > I am not sure if this qualifies as a bug: > > query_to_xml() returns an empty XML document when the query returns no rows, > e.g: > >select query_to_xml('select 42 where false', false, true, ''); > > The problem with this is, that if the resulting

Re: Reindex doesn't eliminate bloat

2018-03-12 Thread Adrian Klaver
On 03/12/2018 03:05 PM, Ron Johnson wrote: v8.4.12 According to this (https://pastebin.com/TJB32n5M) query, which I thought I got from https://wiki.postgresql.org/wiki/Index_Maintenance, a list of indexes and their bloat is generated. After reindexing a table with a large amount of reported

Re: Reindex doesn't eliminate bloat

2018-03-12 Thread Ron Johnson
On 03/12/2018 05:55 PM, Adrian Klaver wrote: On 03/12/2018 03:05 PM, Ron Johnson wrote: v8.4.12 According to this (https://pastebin.com/TJB32n5M) query, which I thought I got from https://wiki.postgresql.org/wiki/Index_Maintenance, a list of indexes and their bloat is generated. After reind

Re: Logical decoding on standby

2018-03-12 Thread Andreas Kretschmer
On 12 March 2018 21:18:22 CET, Andreas Joseph Krogh wrote: >Anybody knows if $subject will make it into v11? >  >-- >Andreas Joseph Krogh Why do you think you needs this? Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company

Re: Logical decoding on standby

2018-03-12 Thread Andreas Kretschmer
On 13 March 2018 00:58:27 CET, Andreas Kretschmer wrote: >On 12 March 2018 21:18:22 CET, Andreas Joseph Krogh > wrote: >>Anybody knows if $subject will make it into v11? >>  >>-- >>Andreas Joseph Krogh > >Why do you think you needs this? > >Regards, Andreas Let me explain my question. One of th

Re: Logical decoding on standby

2018-03-12 Thread David G. Johnston
On Mon, Mar 12, 2018 at 5:08 PM, Andreas Kretschmer wrote: > Let me explain my question. One of the key aspects of logical replication > is, that you can define what to replicate. That wouldn't work in this way, > that's why i'm asking. One of the key aspects of "standby" is that it is ready to

Sv: Re: Logical decoding on standby

2018-03-12 Thread Andreas Joseph Krogh
På tirsdag 13. mars 2018 kl. 01:08:03, skrev Andreas Kretschmer < andr...@a-kretschmer.de >: On 13 March 2018 00:58:27 CET, Andreas Kretschmer wrote: >On 12 March 2018 21:18:22 CET, Andreas Joseph Krogh > wrote: >>Anybody knows if $subject will make it into v11?

Re: Logical decoding on standby

2018-03-12 Thread Andres Freund
Hi, On 2018-03-13 01:08:03 +0100, Andreas Kretschmer wrote: > On 13 March 2018 00:58:27 CET, Andreas Kretschmer > wrote: > >On 12 March 2018 21:18:22 CET, Andreas Joseph Krogh > > wrote: > >>Anybody knows if $subject will make it into v11? I can't see it happening for v11, there's not even a CF

Programmatically duplicating a schema

2018-03-12 Thread matt . figg
Hi all, What is a reliable way to programmatically & generically populate an empty schema with all the objects in the public schema as a template? We are using the multi tenancy ruby gem Apartment ( https://github.com/influitive/apartment ), which was recently broken by the changes made to pg_dump

Re: Reindex doesn't eliminate bloat

2018-03-12 Thread Nikolay Samokhvalov
On Tue, Mar 13, 2018 at 1:28 AM, Ron Johnson wrote: > On 03/12/2018 05:20 PM, Nikolay Samokhvalov wrote: > > On Tue, Mar 13, 2018 at 1:05 AM, Ron Johnson > wrote: > >> v8.4.12 >> > > This is *very* old version, not supported by the community for many years. > Check https://www.postgresql.org/ to

Re: Reindex doesn't eliminate bloat

2018-03-12 Thread Ron Johnson
On 03/12/2018 10:48 PM, Nikolay Samokhvalov wrote: On Tue, Mar 13, 2018 at 1:28 AM, Ron Johnson > wrote: On 03/12/2018 05:20 PM, Nikolay Samokhvalov wrote: On Tue, Mar 13, 2018 at 1:05 AM, Ron Johnson mailto:ron.l.john...@cox.net>> wrote: v8.4.12

Re: Programmatically duplicating a schema

2018-03-12 Thread Adrian Klaver
On 03/12/2018 08:23 PM, matt.f...@internode.on.net wrote: Hi all, What is a reliable way to programmatically & generically populate an empty schema with all the objects in the public schema as a template? We are using the multi tenancy ruby gem Apartment ( https://github.com/influitive/apart

Re: Programmatically duplicating a schema

2018-03-12 Thread matt . figg
Thanks Adrian,   Really appreciate the suggestions.   The objective when trying to solve this for the Apartment library itself is to keep it generic (works for any/all database objects - tables, views, stored procedures, 3rd party extension objects, e