[HACKERS] user space function "is_power_user"

2015-06-21 Thread Pavel Stehule
Hi I often need a function for identification if current user is database owner or is superuser. It can be pretty simply implemented in C level. Do you think it should be available in core? Regards Pavel

Re: [HACKERS] checkpointer continuous flushing

2015-06-21 Thread Fabien COELHO
Hello Andres, So this is an evidence-based decision. Meh. You're testing on low concurrency. Well, I'm just testing on the available box. I do not see the link between high concurrency and whether moving fsync as early as possible would have a large performance impact. I think it might b

Re: [HACKERS] pretty bad n_distinct estimate, causing HashAgg OOM on TPC-H

2015-06-21 Thread Jeff Janes
On Sat, Jun 20, 2015 at 8:28 AM, Tomas Vondra wrote: Hi Tomas, I've lobotomized the sampling a bit to really produce a random set of > blocks first, and that produces way better estimates: > >statistics target estimate random >--

Re: [HACKERS] pretty bad n_distinct estimate, causing HashAgg OOM on TPC-H

2015-06-21 Thread Jeff Janes
On Sat, Jun 20, 2015 at 9:55 AM, Tomas Vondra wrote: > Hi, > > On 06/20/2015 03:01 AM, Jeff Janes wrote: > >> >> >> I don't think we need to really assume the density to be constant, >> maybe we can verify that while collecting the sample? I mean, we're >> already reading the pages, s

Re: [HACKERS] pretty bad n_distinct estimate, causing HashAgg OOM on TPC-H

2015-06-21 Thread Jim Nasby
On 6/20/15 12:55 PM, Tomas Vondra wrote: Well, actually I think it would be even more appropriate for very large tables. With a 2.5TB table, you don't really care whether analyze collects 5GB or 8GB sample, the difference is rather minor compared to I/O generated by the other queries etc. The cur

Re: [HACKERS] Extension support for postgres_fdw

2015-06-21 Thread Jim Nasby
On 6/20/15 12:19 PM, Tom Lane wrote: Note that no matter what the details are, something like this is putting the onus on the DBA to mark as transmittable only functions that actually are safe to transmit, ie they exist*and have identical semantics* on the remote. I think that's fine as long as

Re: [HACKERS] checkpointer continuous flushing

2015-06-21 Thread Jim Nasby
On 6/20/15 2:57 AM, Fabien COELHO wrote: - as version 2: checkpoint buffer sorting based on a 2007 patch by Takahiro Itagaki but with a smaller and static buffer allocated once. Also, sorting is done by chunks of 131072 pages in the current version, with a guc to change this value. I

Re: [HACKERS] Time to get rid of PQnoPasswordSupplied?

2015-06-21 Thread Jim Nasby
On 6/19/15 10:35 AM, Tom Lane wrote: On the other hand, you could argue that improving the string is going to break clients that do the right thing (even if klugily) in order to help clients that are doing the wrong thing (ie, failing without offering the opportunity to enter a password). Ideall

Re: [HACKERS] checkpointer continuous flushing

2015-06-21 Thread Andres Freund
Hi, On 2015-06-20 08:57:57 +0200, Fabien COELHO wrote: > Actually I did, because as explained in another mail the fsync time when the > other options are activated as reported in the logs is essentially null, so > it would not bring significant improvements on these runs, > and also the patch chan

Re: [HACKERS] Is Postgres database server works fine if there is a change in system time?

2015-06-21 Thread Prakash Itnal
Hi, The more detailed discussion is on other mail chain with subject line: "Auto-vacuum is not running in 9.1.12" I agree there is no issue if time shifts by small amount. This issue is serious only if there is big time shifts. In our product the database is deployed on remote network elements an

Re: [HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-21 Thread Amit Kapila
On Sat, Jun 20, 2015 at 10:57 PM, Alvaro Herrera wrote: > > Vik Fearing wrote: > > > Session 1: > > begin; > > alter default privileges in schema bug grant all on tables to postgres; > > > > Session 2: > > alter default privileges in schema bug grant all on tables to postgres; > > > > > > Session

Re: [HACKERS] proposal: row_to_array function

2015-06-21 Thread Craig Ringer
On 2 April 2015 at 01:59, Merlin Moncure wrote: > On Sun, Mar 29, 2015 at 1:27 PM, Tom Lane wrote: >> Pavel Stehule writes: >>> here is rebased patch. >>> It contains both patches - row_to_array function and foreach array support. >> >> While I don't have a problem with hstore_to_array, I don't

Re: [HACKERS] [Proposal] Progress bar for pg_dump/pg_restore

2015-06-21 Thread Craig Ringer
On 19 June 2015 at 16:45, Taiki Kondo wrote: > Hi, andres > > Thank you for your comment, and sorry for late response. > >> The question is how to actually get useful estimates. As there's no >> progress report for indvidiual COPY and CREATE INDEX commands you'll, in >> many cases, have very irreg

Re: [HACKERS] Is Postgres database server works fine if there is a change in system time?

2015-06-21 Thread Craig Ringer
On 17 June 2015 at 15:36, Prakash Itnal wrote: > Hi, > > Currently we observed that certain postgres child process, for eg. > autovacuum worker, are not working as expected if there is a system time > change. So I wanted to know if postgres already supports system time changes > or not. In genera

Re: [HACKERS] Time to get rid of PQnoPasswordSupplied?

2015-06-21 Thread Craig Ringer
On 19 June 2015 at 22:35, Tom Lane wrote: > Robert Haas writes: >> On Sun, Jun 14, 2015 at 11:34 PM, Craig Ringer wrote: >>> I frequently see users confused by one of our more common and less >>> clear error messages: >>> >>> fe_sendauth: no password supplied > >> I've never seen this error mess

Re: [HACKERS] Backpatch src/test/modules to 9.3?

2015-06-21 Thread Michael Paquier
On Mon, Jun 22, 2015 at 1:48 AM, Tom Lane wrote: > Andres Freund writes: >> When discussing multixacts around pgcon (including the developer >> meeting) we decided that we want to add test code to make exercising the >> truncation code easier. > >> In master the most logical place for that seems

Re: [HACKERS] SSL TAP tests and chmod

2015-06-21 Thread Michael Paquier
On Fri, Jun 19, 2015 at 2:49 PM, Michael Paquier wrote: > The TAP tests in src/test/ssl are using system() in combination with > chmod, but perl has a command chmod integrated into it, and it would > work better on Windows as well. > The attached patch is aimed at fixing that. For the sake of the

Re: [HACKERS] pgbench - allow backslash-continuations in custom scripts

2015-06-21 Thread Fabien COELHO
The worst case with pgbench is that we break two people's test scripts, they read the release notes, and fix them. Sure, I agree that breaking pgbench custom scripts compatibility is no big deal, and having pgbench consistent with psql is useful. -- Fabien. -- Sent via pgsql-hackers maili

Re: [HACKERS] pgbench - allow backslash-continuations in custom scripts

2015-06-21 Thread Josh Berkus
Fabien, > Without a lexer it is possible to fool pgbench with somehow contrived > examples, say with: > > SELECT 'hello; > world'; > > The ";" within the string will be considered as end-of-line. > > Also, comments intermixed with sql on the same line would generate errors. > > SELECT

Re: [HACKERS] castoroides spinlock failure on test_shm_mq

2015-06-21 Thread Andres Freund
On 2015-06-20 09:35:39 -0400, Robert Haas wrote: > On Sat, Jun 20, 2015 at 12:24 AM, Alvaro Herrera > wrote: > > Has anybody noticed the way castoroides is randomly failing? > > > > SELECT test_shm_mq_pipelined(16384, (select > > string_agg(chr(32+(random()*95)::int), '') from generate_series(1

Re: [HACKERS] pg_stat_*_columns?

2015-06-21 Thread Andres Freund
On 2015-06-21 12:40:50 -0400, Tom Lane wrote: > Andres Freund writes: > > We could also just mmap() the stats file into memory in various > > processes. With a bit care it should be quite possible to only mmap a > > subsets of the file at once, taking care of the address space issues. > > I think

Re: [HACKERS] Backpatch src/test/modules to 9.3?

2015-06-21 Thread Tom Lane
Andres Freund writes: > When discussing multixacts around pgcon (including the developer > meeting) we decided that we want to add test code to make exercising the > truncation code easier. > In master the most logical place for that seems to be src/test/modules. > Unfortunately 9.3/9.4 don't hav

Re: [HACKERS] pg_stat_*_columns?

2015-06-21 Thread Tom Lane
Andres Freund writes: > On 2015-06-20 10:55:03 -0400, Tom Lane wrote: >> I dunno that tweaking the format would accomplish much. Where I'd love >> to get to is to not have to write the data to disk at all (except at >> shutdown). But that seems to require an adjustable-size shared memory >> bloc

[HACKERS] Backpatch src/test/modules to 9.3?

2015-06-21 Thread Andres Freund
Hi, When discussing multixacts around pgcon (including the developer meeting) we decided that we want to add test code to make exercising the truncation code easier. In master the most logical place for that seems to be src/test/modules. Unfortunately 9.3/9.4 don't have that. Given that the multi

Re: [HACKERS] Inheritance planner CPU and memory usage change since 9.3.2

2015-06-21 Thread Tom Lane
Dean Rasheed writes: > However, there's an obvious improvement that can be made to Tom's > patch -- having computed modifiableARIindexes, you may as well use it > in the innermost loop to only apply ChangeVarNodes() to those > AppendRelInfo's that can actually change, rather than having it trawl >

Re: [HACKERS] pg_stat_*_columns?

2015-06-21 Thread Andres Freund
On 2015-06-20 10:55:03 -0400, Tom Lane wrote: > I dunno that tweaking the format would accomplish much. Where I'd love > to get to is to not have to write the data to disk at all (except at > shutdown). But that seems to require an adjustable-size shared memory > block, and I'm not sure how to do

Re: [HACKERS] pg_stat_*_columns?

2015-06-21 Thread Magnus Hagander
On Sat, Jun 20, 2015 at 11:55 PM, Robert Haas wrote: > On Sat, Jun 20, 2015 at 7:01 PM, Tom Lane wrote: > >> But if the structure > >> got too big to map (on a 32-bit system), then you'd be sort of hosed, > >> because there's no way to attach just part of it. That might not be > >> worth worryi

Re: [HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-21 Thread Andres Freund
On 2015-06-21 11:45:24 -0300, Alvaro Herrera wrote: > Alvaro Herrera wrote: > > > Now that I actually check with a non-relation object, I see pretty much > > the same error. So probably if instead of some narrow bug fix what we > > need is some general solution for all object types. I know this

Re: [HACKERS] 9.5 make world failing due to sgml tools missing

2015-06-21 Thread Peter Eisentraut
On 6/18/15 8:54 AM, Tom Lane wrote: > Sure; the point is that libxml2 has suddenly been reclassified as a > documentation build tool, which is at least a surprising categorization. libxml2 has been a required documentation build tool since PostgreSQL 9.0. The only thing that's new is that xmllint

Re: [HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-21 Thread Alvaro Herrera
Alvaro Herrera wrote: > Now that I actually check with a non-relation object, I see pretty much > the same error. So probably if instead of some narrow bug fix what we > need is some general solution for all object types. I know this has > been discussed a number of times ... Anyway I see now t

[HACKERS] get_relation_info comment out of sync

2015-06-21 Thread Thomas Munro
Hi The comment for get_relation_info should probably include serverid in the list of rel members that it can update (see attached). -- Thomas Munro http://www.enterprisedb.com get_relation_info-comment.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postg

Re: [HACKERS] Inheritance planner CPU and memory usage change since 9.3.2

2015-06-21 Thread Robert Haas
On Sun, Jun 21, 2015 at 5:45 AM, Dean Rasheed wrote: > On 21 June 2015 at 05:27, Robert Haas wrote: >> On Sat, Jun 20, 2015 at 6:48 PM, Tom Lane wrote: >>> I propose instead the attached patch, which operates by identifying which >>> of the append_rel_list entries actually contain subquery refer

Re: [HACKERS] Inheritance planner CPU and memory usage change since 9.3.2

2015-06-21 Thread Dean Rasheed
On 21 June 2015 at 05:27, Robert Haas wrote: > On Sat, Jun 20, 2015 at 6:48 PM, Tom Lane wrote: >> I propose instead the attached patch, which operates by identifying which >> of the append_rel_list entries actually contain subquery references, and >> copying only those; the other ones are just l

Re: [HACKERS] Auto-vacuum is not running in 9.1.12

2015-06-21 Thread Prakash Itnal
Hi, To my understanding it will probably not open doors for worst situations! Please correct if my below understanding is correct. The latch will wake up under below three situations: a) Socket error (=> result is set to negative number) b) timeout (=> result is set to TIMEOUT) c) some event arri

Re: [HACKERS] pgbench - allow backslash-continuations in custom scripts

2015-06-21 Thread Fabien COELHO
Hello Josh, Add backslash continuations to pgbench custom scripts. [...] IMHO this approach is the best compromise. I don't personally agree. I believe that it it worth breaking backwards compatibility to support line breaks in pgbench statements, and that if we're not going to do that, supp