Re: [HACKERS] row_security GUC, BYPASSRLS

2015-09-18 Thread Noah Misch
On Tue, Sep 15, 2015 at 03:18:21PM -0400, Adam Brightwell wrote: > On Tue, Sep 15, 2015 at 2:26 PM, Joe Conway wrote: > >> Joe Conway writes: > >>> There are use cases where row_security=force will be set in production > >>> environments, not only in

Re: [HACKERS] creating extension including dependencies

2015-09-18 Thread Jeff Janes
On Sep 17, 2015 7:52 PM, "Petr Jelinek" wrote: > > On 2015-09-17 17:31, Jeff Janes wrote: >> >> >> Also, It would be nice to have psql tab complete the word CASCADE. >> > > Hmm, it already does? Indeed it does. Oops. I need to run the program I just compiled, and not some

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Michael Paquier
On Fri, Sep 18, 2015 at 12:34 PM, Michael Paquier wrote: > On Fri, Sep 18, 2015 at 9:00 AM, Alexander Korotkov wrote: >> BTW, it would be an option to generate system_identifier to each new >> timeline, by analogy of initdb do for the whole WAL. >> Having such

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Michael Paquier
On Fri, Sep 18, 2015 at 6:25 PM, Michael Paquier wrote: > The refactoring of getTimelineHistory as you propose looks like a good > idea to me, I tried to remove by myself the difference between source > and target in copy_fetch.c and friends but this gets uglier, > particularly because of

Re: [HACKERS] TABLESAMPLE patch is really in pretty sad shape

2015-09-18 Thread Peter Eisentraut
On 7/23/15 6:39 PM, Tom Lane wrote: > + 2202HEERRCODE_INVALID_TABLESAMPLE_ARGUMENT > invalid_tablesample_argument > + 2202GEERRCODE_INVALID_TABLESAMPLE_REPEAT > invalid_tablesample_repeat Where did you get these error codes

Re: [HACKERS] row_security GUC, BYPASSRLS

2015-09-18 Thread Noah Misch
On Fri, Sep 18, 2015 at 09:01:15AM -0400, Adam Brightwell wrote: > > 2. remove SECURITY_ROW_LEVEL_DISABLED; make ri_triggers.c subject to > > policies > > I believe this one has already been addressed by Stephen > (20150910192313.gt3...@tamriel.snowman.net)? Are there further > considerations

Re: [HACKERS] extend pgbench expressions with functions

2015-09-18 Thread Fabien COELHO
Hello Kyotaro-san, My description should have been obscure. Indeed the call tree is finite for *sane* expression node. But it makes infinit call for a value of expr->etype unknown by both evalDouble and evalInt. Such issue would be detected if the function is actually tested, hopefully this

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-09-18 Thread Pavel Stehule
2015-09-18 10:59 GMT+02:00 Shulgin, Oleksandr : > On Thu, Sep 17, 2015 at 10:13 PM, Robert Haas > wrote: > >> On Thu, Sep 17, 2015 at 11:16 AM, Pavel Stehule >> wrote: >> >> >> Second, using a shm_mq manipulates the

Re: [HACKERS] [patch] Proposal for \rotate in psql

2015-09-18 Thread Pavel Stehule
3. When data are multiattribute - then merging together with space > separator is not practical > > * important information is lost > * same transformation can be done as expression, so this feature is > useless > > Is possible to use one cell per attribute (don't do merge)? > > DATA QUERY:

Re: [HACKERS] checkpointer continuous flushing

2015-09-18 Thread Fabien COELHO
Hello, [...] If you make the sorting criterion include the tablespace id you wouldn't need the lookahead loop in NextBufferToWrite(). I'm considering this precise point, i.e. including the tablespace as a sorting criterion. Currently the array used for sorting is 16 bytes per buffer

Re: [HACKERS] Freeze avoidance of very large table.

2015-09-18 Thread Fujii Masao
On Fri, Sep 4, 2015 at 2:55 PM, Masahiko Sawada wrote: > On Fri, Sep 4, 2015 at 10:35 AM, Fujii Masao wrote: >> On Fri, Sep 4, 2015 at 2:23 AM, Masahiko Sawada >> wrote: >>> On Thu, Aug 27, 2015 at 1:54 AM, Masahiko Sawada

Re: [HACKERS] numbering plan nodes

2015-09-18 Thread Kouhei Kaigai
> On Thu, Sep 17, 2015 at 9:01 PM, Kouhei Kaigai wrote: > > I entirely agree with the idea of plan-node identifier, however, > > uncertain whether the node-id shall represent physical location on > > the dynamic shared memory segment, because > > (1) Relatively smaller

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-09-18 Thread Shulgin, Oleksandr
On Thu, Sep 17, 2015 at 10:13 PM, Robert Haas wrote: > On Thu, Sep 17, 2015 at 11:16 AM, Pavel Stehule > wrote: > > >> Second, using a shm_mq manipulates the state of the process latch. I > >> don't think you can make the assumption that it's

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-09-18 Thread Shulgin, Oleksandr
On Fri, Sep 18, 2015 at 11:25 AM, Pavel Stehule wrote: > 2015-09-18 10:59 GMT+02:00 Shulgin, Oleksandr < > oleksandr.shul...@zalando.de>: > >> >> If we take the per-backend slot approach the locking seems unnecessary >> and there are principally two options: >> >> 1) The

Re: [HACKERS] synchronous_commit = apply

2015-09-18 Thread Thomas Munro
On Fri, Sep 18, 2015 at 7:06 PM, Kyotaro HORIGUCHI wrote: > Hello, I have some random comments. Thanks for the feedback! I have fixed several of the things that you found in the attached new version -- see comments inline below. However, I now know that Simon

Re: [HACKERS] [COMMITTERS] pgsql: Add pages deleted from pending list to FSM

2015-09-18 Thread Jeff Janes
On Fri, Sep 18, 2015 at 6:27 AM, Tom Lane wrote: > [ moving thread to -hackers ] > > Fujii Masao writes: > > So autoanalyze still doesn't call IndexFreeSpaceMapVacuum(). > > That is, only backend can clean the list in INSERT-only workload. > > I don't

Re: [HACKERS] Parallel Seq Scan

2015-09-18 Thread Robert Haas
On Fri, Sep 18, 2015 at 12:56 PM, Robert Haas wrote: > On Thu, Sep 17, 2015 at 11:44 PM, Amit Kapila wrote: >> Okay, but I think the same can be achieved with this as well. Basic idea >> is that each worker will work on one planned statement at a

Re: [HACKERS] [patch] Proposal for \rotate in psql

2015-09-18 Thread Daniel Verite
Pavel Stehule wrote: > 2. Data column are not well aligned - numbers are aligned as text Thanks for spotting that, it's fixed in the attached new iteration of the patch. > 3. When data are multiattribute - then merging together with space separator > is not practical > > * important

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-18 Thread Vladimir Borodin
> 18 сент. 2015 г., в 20:16, Robert Haas написал(а): > > On Fri, Sep 18, 2015 at 4:08 AM, Vladimir Borodin wrote: >> For both scenarios on linux we got approximately the same results - version >> with timings was faster then version with sampling

Re: [HACKERS] Speed up Clog Access by increasing CLOG buffers

2015-09-18 Thread Amit Kapila
On Fri, Sep 18, 2015 at 11:08 PM, Jesper Pedersen < jesper.peder...@redhat.com> wrote: > On 09/11/2015 10:31 AM, Amit Kapila wrote: > >> Updated comments and the patch (increate_clog_bufs_v2.patch) >> containing the same is attached. >> >> > I have done various runs on an Intel Xeon 28C/56T w/

Re: [HACKERS] Reducing ClogControlLock contention

2015-09-18 Thread Amit Kapila
On Fri, Sep 18, 2015 at 11:31 PM, Jesper Pedersen < jesper.peder...@redhat.com> wrote: > On 08/31/2015 07:34 AM, Amit Kapila wrote: > >> I have updated the patch (attached with mail) to show >> you what I have in mind. >> >> > I havn't been able to get a successful run with _v5 using pgbench. > >

Re: [HACKERS] [patch] Proposal for \rotate in psql

2015-09-18 Thread Pavel Stehule
> You're suggesting a [d] choice, subdividing the horizontal headers. > It seems to me like a pretty radical change, multiplying the number > of columns, and it has also the potential to give poor results visually. > Let's see if more feedback comes. > yes, I know, plan @d needs lot of new code -

Re: [HACKERS] Parallel Seq Scan

2015-09-18 Thread Haribabu Kommi
On Fri, Sep 18, 2015 at 9:45 PM, Amit Kapila wrote: > On Fri, Sep 18, 2015 at 1:33 PM, Haribabu Kommi > wrote: >> >> On Thu, Sep 3, 2015 at 8:21 PM, Amit Kapila >> wrote: >> > >> > Attached, find the rebased version of

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Michael Paquier
On Wed, Sep 16, 2015 at 9:47 AM, Alexander Korotkov wrote: > On Thu, Sep 10, 2015 at 8:33 AM, Michael Paquier wrote: > OK, I get it. I tried to get rid of code duplication in the attached patch. > There is getTimelineHistory() function which gets control file as argument > and fetches history from

Re: [HACKERS] Parallel Seq Scan

2015-09-18 Thread Amit Kapila
On Thu, Sep 17, 2015 at 2:28 AM, Robert Haas wrote: > > On Thu, Sep 3, 2015 at 6:21 AM, Amit Kapila wrote: > +/* > + * We expect each worker to populate the BufferUsage structure > + * allocated by master backend and then master backend

Re: [HACKERS] Parallel Seq Scan

2015-09-18 Thread Amit Kapila
On Fri, Sep 18, 2015 at 1:33 PM, Haribabu Kommi wrote: > On Thu, Sep 3, 2015 at 8:21 PM, Amit Kapila > wrote: > > > > Attached, find the rebased version of patch. > > Here are the performance test results: > > Query selectivity

Re: [HACKERS] [patch] Proposal for \rotate in psql

2015-09-18 Thread Daniel Verite
Pavel Stehule wrote: > my comments: > > 1. I don't understand why you are use two methods for sorting columns > (qsort, and query with ORDER BY) qsort (with strcmp as the comparator) is only used to determine the set of distinct values for the vertical and horizontal headers. In fact

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-09-18 Thread Shulgin, Oleksandr
On Fri, Sep 18, 2015 at 12:59 PM, Pavel Stehule wrote: > 2015-09-18 12:05 GMT+02:00 Shulgin, Oleksandr < > oleksandr.shul...@zalando.de>: > >> On Fri, Sep 18, 2015 at 11:25 AM, Pavel Stehule >> wrote: >> >>> >>> It should not be true - the data

Re: [HACKERS] [patch] Proposal for \rotate in psql

2015-09-18 Thread Daniel Verite
Pavel Stehule wrote: > in the help inside your last patch, you are using "crosstab". Cannto be > crosstab the name for this feature? If it wasn't taken already by contrib/tablefunc, that would be a first choice. But now, when searching for crosstab+postgresql, pages of results come out

Re: [HACKERS] Parallel Seq Scan

2015-09-18 Thread Amit Kapila
On Thu, Sep 17, 2015 at 4:44 PM, Robert Haas wrote: > On Thu, Sep 17, 2015 at 2:54 AM, Amit Kapila wrote: > > > > Here the subplan is generated before the top level plan and while generation > > of subplan we can't predict whether it is okay to

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-09-18 Thread Pavel Stehule
2015-09-18 12:05 GMT+02:00 Shulgin, Oleksandr : > On Fri, Sep 18, 2015 at 11:25 AM, Pavel Stehule > wrote: > >> 2015-09-18 10:59 GMT+02:00 Shulgin, Oleksandr < >> oleksandr.shul...@zalando.de>: >> >>> >>> If we take the per-backend slot

Re: [HACKERS] Freeze avoidance of very large table.

2015-09-18 Thread Masahiko Sawada
On Fri, Sep 18, 2015 at 6:13 PM, Fujii Masao wrote: > On Fri, Sep 4, 2015 at 2:55 PM, Masahiko Sawada wrote: >> On Fri, Sep 4, 2015 at 10:35 AM, Fujii Masao wrote: >>> On Fri, Sep 4, 2015 at 2:23 AM, Masahiko Sawada

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-09-18 Thread Pavel Stehule
2015-09-18 13:22 GMT+02:00 Shulgin, Oleksandr : > On Fri, Sep 18, 2015 at 12:59 PM, Pavel Stehule > wrote: > >> 2015-09-18 12:05 GMT+02:00 Shulgin, Oleksandr < >> oleksandr.shul...@zalando.de>: >> >>> On Fri, Sep 18, 2015 at 11:25 AM, Pavel

Re: [HACKERS] [patch] Proposal for \rotate in psql

2015-09-18 Thread Pavel Stehule
2015-09-18 13:36 GMT+02:00 Daniel Verite : > Pavel Stehule wrote: > > > in the help inside your last patch, you are using "crosstab". Cannto be > > crosstab the name for this feature? > > If it wasn't taken already by contrib/tablefunc, that would be a first >

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-09-18 Thread Robert Haas
On Thu, Sep 17, 2015 at 12:47 PM, Shulgin, Oleksandr wrote: > But if we make the sender backend create the DSM with the response payload, > it suddenly becomes really unclear at which point and who should make the > final detach of that DSM. We're getting back to

Re: [HACKERS] [patch] Proposal for \rotate in psql

2015-09-18 Thread Pavel Stehule
2015-09-18 13:59 GMT+02:00 Daniel Verite : > Pavel Stehule wrote: > > > > my comments: > > > > 1. I don't understand why you are use two methods for sorting columns > > (qsort, and query with ORDER BY) > > qsort (with strcmp as the comparator) is only used to

Re: [HACKERS] synchronous_commit = apply

2015-09-18 Thread Kyotaro HORIGUCHI
Hello, I have some random comments. At Wed, 16 Sep 2015 23:07:03 +1200, Thomas Munro wrote in

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-18 Thread Vladimir Borodin
> 16 сент. 2015 г., в 20:52, Robert Haas написал(а): > > On Wed, Sep 16, 2015 at 12:29 PM, Alexander Korotkov > wrote: >> Yes, the major question is cost. But I think we should validate our thoughts >> by experiments assuming there are more possible

Re: [HACKERS] row_security GUC, BYPASSRLS

2015-09-18 Thread Joe Conway
On 09/18/2015 09:25 AM, Adam Brightwell wrote: >>> 1. remove row_security=force >>> 2. remove SECURITY_ROW_LEVEL_DISABLED; make ri_triggers.c subject to >>> policies >>> 3. add DDL-controlled, per-table policy forcing >>> >>> They ought to land in that order. PostgreSQL 9.5 would need at least

Re: [HACKERS] [COMMITTERS] pgsql: Add pages deleted from pending list to FSM

2015-09-18 Thread Teodor Sigaev
Reply to both emails in one Fujii: > So autoanalyze still doesn't call IndexFreeSpaceMapVacuum(). Fixed, see patch > ginvacuumcleanup calls RecordFreeIndexPage() twice for the same block. fixed too Tom: It seems quite bizarre for auto-analyze to do that. auto-vacuum, sure, but I do not

Re: [HACKERS] tsvector work with citext

2015-09-18 Thread Teodor Sigaev
Fixable? Fixed (9acb9007de30b3daaa9efc16763c3bc6e3e0a92d), but didn't backpatch because it isn't a critical bug. Thank you for the report! -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW:

Re: [HACKERS] row_security GUC, BYPASSRLS

2015-09-18 Thread Adam Brightwell
>> 1. remove row_security=force >> 2. remove SECURITY_ROW_LEVEL_DISABLED; make ri_triggers.c subject to policies >> 3. add DDL-controlled, per-table policy forcing >> >> They ought to land in that order. PostgreSQL 9.5 would need at least (1) and >> (2); would RLS experts find it beneficial for

Re: [HACKERS] [COMMITTERS] pgsql: Fix an O(N^2) problem in foreign key references.

2015-09-18 Thread Tom Lane
Jan Wieck writes: > Attached is a complete rework of the fix from scratch, based on Tom's > suggestion. > The code now maintains a double linked list as suggested, but only uses > it to mark all currently valid entries as invalid when hashvalue == 0. > If a specific entry is

Re: [HACKERS] row_security GUC, BYPASSRLS

2015-09-18 Thread Adam Brightwell
> 2. remove SECURITY_ROW_LEVEL_DISABLED; make ri_triggers.c subject to policies I believe this one has already been addressed by Stephen (20150910192313.gt3...@tamriel.snowman.net)? Are there further considerations for his proposed changes? -Adam -- Adam Brightwell -

Re: [HACKERS] row_security GUC, BYPASSRLS

2015-09-18 Thread Joe Conway
On 09/18/2015 01:07 AM, Noah Misch wrote: > Great. Robert, does that work for you, too? If so, this sub-thread is > looking at three patches: > > 1. remove row_security=force > 2. remove SECURITY_ROW_LEVEL_DISABLED; make ri_triggers.c subject to policies > 3. add DDL-controlled, per-table

Re: [HACKERS] [COMMITTERS] pgsql: Add pages deleted from pending list to FSM

2015-09-18 Thread Teodor Sigaev
-- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] [COMMITTERS] pgsql: Add pages deleted from pending list to FSM

2015-09-18 Thread Tom Lane
[ moving thread to -hackers ] Fujii Masao writes: > So autoanalyze still doesn't call IndexFreeSpaceMapVacuum(). > That is, only backend can clean the list in INSERT-only workload. > I don't think that this is desirable. Because the backend will > periodically take a big

Re: [HACKERS] row_security GUC, BYPASSRLS

2015-09-18 Thread Robert Haas
On Fri, Sep 18, 2015 at 2:07 AM, Noah Misch wrote: > On Tue, Sep 15, 2015 at 03:18:21PM -0400, Adam Brightwell wrote: >> On Tue, Sep 15, 2015 at 2:26 PM, Joe Conway wrote: >> >> Joe Conway writes: >> >>> There are use cases where

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Alexander Korotkov
On Wed, Sep 16, 2015 at 7:47 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Thu, Sep 10, 2015 at 8:33 AM, Michael Paquier < > michael.paqu...@gmail.com> wrote: > >> On Wed, Sep 9, 2015 at 7:13 PM, Alexander Korotkov wrote: > > > A also added additional check in

Re: [HACKERS] Parallel Seq Scan

2015-09-18 Thread Robert Haas
On Thu, Sep 17, 2015 at 11:44 PM, Amit Kapila wrote: > Okay, but I think the same can be achieved with this as well. Basic idea > is that each worker will work on one planned statement at a time and in > above case there will be two different planned statements and they

Re: [HACKERS] extend pgbench expressions with functions

2015-09-18 Thread Fabien COELHO
-1. double is an inexact type, whereas integer is an exact type. Sure. I already argue on that very line. The typical way to handle this sort of thing is to define a struct whose first member is a type field and whose second field is a union of all the types you need to care about. Yep.

Re: [HACKERS] tsvector work with citext

2015-09-18 Thread Tom Lane
"David E. Wheeler" writes: > On Sep 18, 2015, at 7:29 AM, Teodor Sigaev wrote: >> Fixed (9acb9007de30b3daaa9efc16763c3bc6e3e0a92d), but didn't backpatch >> because it isn't a critical bug. > Great, thank you! > For those on older versions, what’s the

Re: [HACKERS] vacuumdb sentence

2015-09-18 Thread Robert Haas
On Fri, Sep 18, 2015 at 12:18 AM, Euler Taveira wrote: > Yeah, I know. [Too sleepy to be writing emails...] What I want to say is: > when we want to refer to an option, we usually add "option" after the quoted > name (in this case, it won't make sense). I propose to remove

Re: [HACKERS] Parallel Seq Scan

2015-09-18 Thread Robert Haas
On Fri, Sep 18, 2015 at 4:03 AM, Haribabu Kommi wrote: > On Thu, Sep 3, 2015 at 8:21 PM, Amit Kapila wrote: >> >> Attached, find the rebased version of patch. > > Here are the performance test results: Thanks, this is really interesting. I'm

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-18 Thread Nikolay Shaplov
В письме от 11 сентября 2015 15:12:04 Вы написали: > > Ok.Let's come to the final decision with tuple_data_parse, and i will add > > this switch there and to pure sql heap_page_item_attrs > > Fine for me. So I've modified the code, now we have: heap_page_items - have a column with raw tuple

Re: [HACKERS] tsvector work with citext

2015-09-18 Thread David E. Wheeler
On Sep 18, 2015, at 7:29 AM, Teodor Sigaev wrote: >> Fixable? > > Fixed (9acb9007de30b3daaa9efc16763c3bc6e3e0a92d), but didn't backpatch > because it isn't a critical bug. Great, thank you! For those on older versions, what’s the simplest workaround? Best, David --

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-09-18 Thread Robert Haas
On Fri, Sep 18, 2015 at 6:59 AM, Pavel Stehule wrote: > I am afraid so it has not simple and nice solution - when data sender will > wait for to moment when data are received, then we have same complexity like > we use shm_mq. > > Isn't better to introduce new background

Re: [HACKERS] numbering plan nodes

2015-09-18 Thread Robert Haas
On Fri, Sep 18, 2015 at 5:24 AM, Kouhei Kaigai wrote: >> On Thu, Sep 17, 2015 at 9:01 PM, Kouhei Kaigai wrote: >> > I entirely agree with the idea of plan-node identifier, however, >> > uncertain whether the node-id shall represent physical location on

Re: [HACKERS] extend pgbench expressions with functions

2015-09-18 Thread Robert Haas
On Thu, Sep 17, 2015 at 10:58 PM, Kyotaro HORIGUCHI wrote: > By the way, the complexity comes from separating integer and > double. If there is no serios reason to separate them, handling > all values as double makes things far simpler. -1. double is an inexact

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-18 Thread Robert Haas
On Fri, Sep 18, 2015 at 4:08 AM, Vladimir Borodin wrote: > For both scenarios on linux we got approximately the same results - version > with timings was faster then version with sampling (sampling was done every > 10 ms). Vanilla PostgreSQL from REL9_4_STABLE gave ~15500 tps

Re: [HACKERS] Parallel Seq Scan

2015-09-18 Thread Robert Haas
On Fri, Sep 18, 2015 at 6:55 AM, Amit Kapila wrote: >> +currentRelation = ExecOpenScanRelation(estate, >> + ((SeqScan *) >> node->ss.ps.plan)->scanrelid, >> + eflags); >> >> I can't

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Michael Paquier
On Fri, Sep 18, 2015 at 9:00 AM, Alexander Korotkov wrote: > BTW, it would be an option to generate system_identifier to each new > timeline, by analogy of initdb do for the whole WAL. > Having such system_identifiers we can distinguish different timeline which > have assigned same ids. > Any