[COMMITTERS] pgsql: Have TRUNCATE update pgstat tuple counters

2015-02-20 Thread Alvaro Herrera
Have TRUNCATE update pgstat tuple counters This works by keeping a per-subtransaction record of the ins/upd/del counters before the truncate, and then resetting them; this record is useful to return to the previous state in case the truncate is rolled back, either in a subtransaction or whole tran

Re: [COMMITTERS] pgsql: Have TRUNCATE update pgstat tuple counters

2015-02-20 Thread Tom Lane
Alvaro Herrera writes: > Have TRUNCATE update pgstat tuple counters > Catalog version bumped due to the change in pgstat format. I see no catversion.h change here, which is probably a good thing because no such bump should have been made for this change anyway. What *should* have been altered,

Re: [COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.

2015-02-20 Thread Andres Freund
On 2015-02-20 05:12:00 +, Tom Lane wrote: > Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. > > Replace some bogus "x[1]" declarations with "x[FLEXIBLE_ARRAY_MEMBER]". > Aside from being more self-documenting, this should help prevent bogus > warnings from static code analyzers and perhaps c

Re: [COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.

2015-02-20 Thread Andres Freund
On 2015-02-20 16:39:14 +0100, Andres Freund wrote: > SI'll just include -Wno-flexible-array-extensions for now. Even after that I get: /home/andres/src/postgresql/src/backend/utils/adt/tsrank.c:201:2: warning: flexible array initialization is a GNU extension [-Wgnu-flexible-array-initialize

Re: [COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.

2015-02-20 Thread Tom Lane
Andres Freund writes: > Even after that I get: > /home/andres/src/postgresql/src/backend/utils/adt/tsrank.c:201:2: warning: > flexible array initialization is a GNU extension > [-Wgnu-flexible-array-initializer] > {0} > ^ > /home/andres/src/postgresql/src/include/tsearch/ts_

Re: [COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.

2015-02-20 Thread Tom Lane
Andres Freund writes: > This triggers a large number of warnings with my preexisting clang 3.6 > settings... > In file included from > /home/andres/src/postgresql/src/backend/postmaster/pgstat.c:40: > /home/andres/src/postgresql/src/include/catalog/pg_proc.h:61:12: warning: > 'proargtypes' may

[COMMITTERS] pgsql: Update PGSTAT_FILE_FORMAT_ID

2015-02-20 Thread Alvaro Herrera
Update PGSTAT_FILE_FORMAT_ID Previous commit should have bumped it but didn't. Oops. Per note from Tom. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/3b14bb77716a01915da4833194e7c8c1c51da66d Modified Files -- src/include/pgstat.h |2 +- 1 file cha

Re: [COMMITTERS] pgsql: Have TRUNCATE update pgstat tuple counters

2015-02-20 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera writes: > > Have TRUNCATE update pgstat tuple counters > > > Catalog version bumped due to the change in pgstat format. > > I see no catversion.h change here, which is probably a good thing because > no such bump should have been made for this change anyway. Wha

Re: [COMMITTERS] pgsql: Have TRUNCATE update pgstat tuple counters

2015-02-20 Thread Tom Lane
Alvaro Herrera writes: > Now buildfarm member kouprey is failing the added test in > prepared_xacts. I am tempted to just remove it rather than try to fix > it: there's a 0.5s sleep in there (not enough for sure), but it would be > annoying to move it to the stats test which already sleeps howeve

Re: [COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.

2015-02-20 Thread Andres Freund
On 2015-02-20 10:49:32 -0500, Tom Lane wrote: > Andres Freund writes: > > This triggers a large number of warnings with my preexisting clang 3.6 > > settings... > > > In file included from > > /home/andres/src/postgresql/src/backend/postmaster/pgstat.c:40: > > /home/andres/src/postgresql/src/in

[COMMITTERS] pgsql: Remove unnecessary and unreliable test

2015-02-20 Thread Alvaro Herrera
Remove unnecessary and unreliable test Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/8902f79264d95ed84e4c9fb4749b3956b4c74349 Modified Files -- src/test/regress/expected/prepared_xacts.out | 50 -- src/test/regress/expected/prepar

[COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in struct varlena.

2015-02-20 Thread Tom Lane
Use FLEXIBLE_ARRAY_MEMBER in struct varlena. This forces some minor coding adjustments in tuptoaster.c and inv_api.c, but the new coding there is cleaner anyway. Michael Paquier Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/e38b1eb0986990d539e056a65c6b122b295ce932

[COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in struct RecordIOData.

2015-02-20 Thread Tom Lane
Use FLEXIBLE_ARRAY_MEMBER in struct RecordIOData. I (tgl) fixed this last night in rowtypes.c, but I missed that the code had been copied into a couple of other places. Michael Paquier Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/c110eff1324f5c882c737ad988191ed4a

[COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in some more places.

2015-02-20 Thread Tom Lane
Use FLEXIBLE_ARRAY_MEMBER in some more places. Fix a batch of structs that are only visible within individual .c files. Michael Paquier Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/33a3b03d636b529b27f869e332b6344d52635331 Modified Files -- src/backen

[COMMITTERS] pgsql: Fix statically allocated struct with FLEXIBLE_ARRAY_MEMBER membe

2015-02-20 Thread Tom Lane
Fix statically allocated struct with FLEXIBLE_ARRAY_MEMBER member. clang complains about this, not unreasonably, so define another struct that's explicitly for a WordEntryPos with exactly one element. While at it, get rid of pretty dubious use of a static variable for more than one purpose --- if

Re: [COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.

2015-02-20 Thread Tom Lane
Andres Freund writes: > Even after that I get: > /home/andres/src/postgresql/src/backend/utils/adt/tsrank.c:201:2: warning: > flexible array initialization is a GNU extension > [-Wgnu-flexible-array-initializer] > {0} > ^ > /home/andres/src/postgresql/src/include/tsearch/ts_

Re: [COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.

2015-02-20 Thread Alvaro Herrera
Tom Lane wrote: > A relevant technique that's been used in a lot of our code is to define > an intermediate macro, along the lines of > > #define SizeofHeapTupleHeader offsetof(HeapTupleHeaderData, t_bits) > > or maybe it would better be called HeapTupleHeaderFixedSize or > HeapTupleHeaderOverhe

[COMMITTERS] pgsql: Some more FLEXIBLE_ARRAY_MEMBER fixes.

2015-02-20 Thread Tom Lane
Some more FLEXIBLE_ARRAY_MEMBER fixes. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/f2874feb7c4e71200539c0287544eeebd8fcb3d4 Modified Files -- src/backend/optimizer/plan/setrefs.c |5 ++--- src/include/access/brin_page.h |7 ++- src/inc

Re: [COMMITTERS] pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.

2015-02-20 Thread Michael Paquier
On Sat, Feb 21, 2015 at 10:16 AM, Alvaro Herrera wrote: > Tom Lane wrote: > >> A relevant technique that's been used in a lot of our code is to define >> an intermediate macro, along the lines of >> >> #define SizeofHeapTupleHeader offsetof(HeapTupleHeaderData, t_bits) >> >> or maybe it would bett