[COMMITTERS] pgsql: Properly initialize write, flush and replay locations in walsend

2015-12-13 Thread Magnus Hagander
Properly initialize write, flush and replay locations in walsender slots These would leak random xlog positions if a walsender used for backup would a walsender slot previously used by a replication walsender. In passing also fix a couple of cases where the xlog pointer is directly compared to

[COMMITTERS] pgsql: Properly initialize write, flush and replay locations in walsend

2015-12-13 Thread Magnus Hagander
Properly initialize write, flush and replay locations in walsender slots These would leak random xlog positions if a walsender used for backup would a walsender slot previously used by a replication walsender. In passing also fix a couple of cases where the xlog pointer is directly compared to

[COMMITTERS] pgsql: Consistently set all fields in pg_stat_replication to null inste

2015-12-13 Thread Magnus Hagander
Consistently set all fields in pg_stat_replication to null instead of 0 Previously the "sent" field would be set to 0 and all other xlog pointers be set to NULL if there were no valid values (such as when in a backup sending walsender). Branch -- master Details ---

[COMMITTERS] pgsql: Properly initialize write, flush and replay locations in walsend

2015-12-13 Thread Magnus Hagander
Properly initialize write, flush and replay locations in walsender slots These would leak random xlog positions if a walsender used for backup would a walsender slot previously used by a replication walsender. In passing also fix a couple of cases where the xlog pointer is directly compared to

[COMMITTERS] pgsql: Properly initialize write, flush and replay locations in walsend

2015-12-13 Thread Magnus Hagander
Properly initialize write, flush and replay locations in walsender slots These would leak random xlog positions if a walsender used for backup would a walsender slot previously used by a replication walsender. In passing also fix a couple of cases where the xlog pointer is directly compared to

[COMMITTERS] pgsql: Consistently set all fields in pg_stat_replication to null inste

2015-12-13 Thread Magnus Hagander
Consistently set all fields in pg_stat_replication to null instead of 0 Previously the "sent" field would be set to 0 and all other xlog pointers be set to NULL if there were no valid values (such as when in a backup sending walsender). Branch -- REL9_5_STABLE Details ---

Re: [COMMITTERS] pgsql: Fix bug leading to restoring unlogged relations from empty files

2015-12-13 Thread Andres Freund
On 2015-12-13 12:37:18 -0500, Tom Lane wrote: > Andres Freund writes: > > Fix bug leading to restoring unlogged relations from empty files. > > Coverity thinks, quite correctly AFAICS, that this line you wrote in > FlushOneBuffer() is useless: > >

Re: [COMMITTERS] pgsql: Fix bug leading to restoring unlogged relations from empty files

2015-12-13 Thread Tom Lane
Andres Freund writes: > Fix bug leading to restoring unlogged relations from empty files. Coverity thinks, quite correctly AFAICS, that this line you wrote in FlushOneBuffer() is useless: LWLockHeldByMe(bufHdr->content_lock); Perhaps you meant

[COMMITTERS] pgsql: Code and docs review for multiple -c and -f options in psql.

2015-12-13 Thread Tom Lane
Code and docs review for multiple -c and -f options in psql. Commit d5563d7df94488bf drew complaints from Coverity, which quite correctly complained that one copy of each -c or -f string was being leaked. What's more, simple_action_list_append was allocating enough space for still a third copy

Re: [COMMITTERS] pgsql: Fix bug leading to restoring unlogged relations from empty files

2015-12-13 Thread Peter Eisentraut
Coverity is complaining that in void FlushOneBuffer(Buffer buffer) { BufferDesc *bufHdr; /* currently not needed, but no fundamental reason not to support */ Assert(!BufferIsLocal(buffer)); Assert(BufferIsPinned(buffer)); bufHdr = GetBufferDescriptor(buffer - 1);

Re: [COMMITTERS] pgsql: Code and docs review for multiple -c and -f options in psql.

2015-12-13 Thread Michael Paquier
On Mon, Dec 14, 2015 at 11:16 AM, Michael Paquier wrote: > - cell = (SimpleActionListCell *) > - pg_malloc(offsetof(SimpleActionListCell, val) + vallen + 1); > Thanks! Among all those things this bit is a bit shameful.. (I am the one at the origin of that FWIW) -- Michael -- Sent via

Re: [COMMITTERS] pgsql: Code and docs review for multiple -c and -f options in psql.

2015-12-13 Thread Michael Paquier
On Mon, Dec 14, 2015 at 4:52 AM, Tom Lane wrote: > Code and docs review for multiple -c and -f options in psql. > > Commit d5563d7df94488bf drew complaints from Coverity, which quite > correctly complained that one copy of each -c or -f string was being > leaked. What's more,

[COMMITTERS] pgsql: Docs: document that psql's "\i -" means read from stdin.

2015-12-13 Thread Tom Lane
Docs: document that psql's "\i -" means read from stdin. This has worked that way for a long time, maybe always, but you would not have known it from the documentation. Also back-patch the notes I added to HEAD earlier today about behavior of the "-f -" switch, which likewise have been valid for

[COMMITTERS] pgsql: Docs: document that psql's "\i -" means read from stdin.

2015-12-13 Thread Tom Lane
Docs: document that psql's "\i -" means read from stdin. This has worked that way for a long time, maybe always, but you would not have known it from the documentation. Also back-patch the notes I added to HEAD earlier today about behavior of the "-f -" switch, which likewise have been valid for

[COMMITTERS] pgsql: Docs: document that psql's "\i -" means read from stdin.

2015-12-13 Thread Tom Lane
Docs: document that psql's "\i -" means read from stdin. This has worked that way for a long time, maybe always, but you would not have known it from the documentation. Also back-patch the notes I added to HEAD earlier today about behavior of the "-f -" switch, which likewise have been valid for

[COMMITTERS] pgsql: Docs: document that psql's "\i -" means read from stdin.

2015-12-13 Thread Tom Lane
Docs: document that psql's "\i -" means read from stdin. This has worked that way for a long time, maybe always, but you would not have known it from the documentation. Also back-patch the notes I added to HEAD earlier today about behavior of the "-f -" switch, which likewise have been valid for

[COMMITTERS] pgsql: Docs: document that psql's "\i -" means read from stdin.

2015-12-13 Thread Tom Lane
Docs: document that psql's "\i -" means read from stdin. This has worked that way for a long time, maybe always, but you would not have known it from the documentation. Also back-patch the notes I added to HEAD earlier today about behavior of the "-f -" switch, which likewise have been valid for

[COMMITTERS] pgsql: Docs: document that psql's "\i -" means read from stdin.

2015-12-13 Thread Tom Lane
Docs: document that psql's "\i -" means read from stdin. This has worked that way for a long time, maybe always, but you would not have known it from the documentation. Also back-patch the notes I added to HEAD earlier today about behavior of the "-f -" switch, which likewise have been valid for

Re: [COMMITTERS] pgsql: Fix bug leading to restoring unlogged relations from empty files

2015-12-13 Thread Michael Paquier
On Mon, Dec 14, 2015 at 2:26 PM, Peter Eisentraut wrote: > the call to LWLockHeldByMe() is useless. Yes, but it should be an Assert. I guess that Andres is on it.. -- Michael -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your

Re: [COMMITTERS] pgsql: Code and docs review for multiple -c and -f options in psql.

2015-12-13 Thread Pavel Stehule
2015-12-14 3:16 GMT+01:00 Michael Paquier : > On Mon, Dec 14, 2015 at 11:16 AM, Michael Paquier wrote: > > - cell = (SimpleActionListCell *) > > - pg_malloc(offsetof(SimpleActionListCell, val) + vallen + 1); > > Thanks! Among all those things this bit is a bit