Re: [HACKERS] Something flaky in the relfilenode mapping infrastructure

2014-06-12 Thread Andres Freund
On 2014-06-12 00:38:36 -0400, Noah Misch wrote: On Tue, Apr 15, 2014 at 03:28:41PM -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-03-27 08:02:35 -0400, Tom Lane wrote: Buildfarm member prairiedog thinks there's something unreliable about commit

Re: [HACKERS] Something flaky in the relfilenode mapping infrastructure

2014-06-12 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-06-12 00:38:36 -0400, Noah Misch wrote: http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedogdt=2014-06-12%2000%3A17%3A07 Hm. My guess it's that it's just a 'harmless' concurrency issue. The test currently run in concurrency

Re: [HACKERS] Few observations in replication slots related code

2014-06-12 Thread Andres Freund
Hi Amit, On 2014-06-12 08:55:59 +0530, Amit Kapila wrote: 1. In function StartupReplicationSlots(XLogRecPtr checkPointRedo), parameter checkPointRedo is not used. It used to be included in a debug message. Apparently the message was removed at some point (don't remember it, but I have a memory

Re: [HACKERS] Shared memory changes in 9.4?

2014-06-12 Thread Christoph Berg
[redirecting to -hackers] Re: Robert Haas 2014-05-28 CA+TgmoaTcAd48zW3auWzGdHi_V+QwA5HVCTabqgTq=zlwpy...@mail.gmail.com On Tue, May 27, 2014 at 8:22 PM, Maciek Sakrejda m.sakre...@gmail.com wrote: On Mon, May 26, 2014 at 12:24 AM, Andres Freund and...@2ndquadrant.com wrote: Any chance

Re: [HACKERS] Shared memory changes in 9.4?

2014-06-12 Thread Andres Freund
Hi, On 2014-06-12 11:07:31 +0200, Christoph Berg wrote: Re: Robert Haas 2014-05-28 CA+TgmoaTcAd48zW3auWzGdHi_V+QwA5HVCTabqgTq=zlwpy...@mail.gmail.com On Tue, May 27, 2014 at 8:22 PM, Maciek Sakrejda m.sakre...@gmail.com wrote: On Mon, May 26, 2014 at 12:24 AM, Andres Freund

Re: [HACKERS] RETURNING PRIMARY KEY syntax extension

2014-06-12 Thread Jochem van Dieten
On Wed, Jun 11, 2014 at 2:39 AM, Tom Lane wrote: I'm not even 100% sold that automatically returning the primary key is going to save any application logic. Could somebody point out *exactly* where an app is going to save effort with this type of syntax, compared to requesting the columns it

Re: [HACKERS] RETURNING PRIMARY KEY syntax extension

2014-06-12 Thread Ian Barwick
On 14/06/12 18:46, Jochem van Dieten wrote: On Wed, Jun 11, 2014 at 2:39 AM, Tom Lane wrote: I'm not even 100% sold that automatically returning the primary key is going to save any application logic. Could somebody point out *exactly* where an app is going to save effort with

Re: [HACKERS] Few observations in replication slots related code

2014-06-12 Thread Andres Freund
Hi, On 2014-06-12 09:15:08 +0200, Andres Freund wrote: 6. elog(ERROR, cannot handle changeset extraction yet); Shouldn't it be better to use logical replication instead of changeset extraction? Will change. I don't see that message anywhere in current code? All of those were

Re: [HACKERS] replication commands and log_statements

2014-06-12 Thread Fujii Masao
On Wed, Jun 11, 2014 at 11:55 PM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@2ndquadrant.com writes: Your wish just seems like a separate feature to me. Including replication commands in 'all' seems correct independent of the desire for a more granular control. No, I think I've

Re: [HACKERS] Inaccuracy in VACUUM's tuple count estimates

2014-06-12 Thread Andres Freund
Hi Tom, On 2014-06-06 15:44:25 -0400, Tom Lane wrote: I figured it'd be easy enough to get a better estimate by adding another counter to count just LIVE and INSERT_IN_PROGRESS tuples (thus effectively assuming that in-progress inserts and deletes will both commit). Did you plan to backpatch

[HACKERS] Audit of logout

2014-06-12 Thread Fujii Masao
Hi, Some users enable log_disconnections in postgresql.conf to audit all logouts. But since log_disconnections is defined with PGC_BACKEND, it can be changed at connection start. This means that any client (even nonsuperuser) can freely disable log_disconnections not to log his or her logout even

Re: [HACKERS] cancelling statement due to user request error occurs but the transaction has committed.

2014-06-12 Thread Naoya Anzai
Hi, Well, the only other principled fix I can see is to add a new reponse along the lines of ERRORBUTITCOMMITTED, which does not seem attractive either, since all clients will have to be taught to understand it. +1 I think current specification hard to understand for many users. It is really

Re: [HACKERS] RETURNING PRIMARY KEY syntax extension

2014-06-12 Thread Jochem van Dieten
On Thu, Jun 12, 2014 at 12:25 PM, Ian Barwick wrote: On 14/06/12 18:46, Jochem van Dieten wrote: I haven't checked the code, but I am hoping it will help with the problem where a RETURNING * is added to a statement that is not an insert or update by the JDBC driver. That has been reported

Re: [HACKERS] RETURNING PRIMARY KEY syntax extension

2014-06-12 Thread Andres Freund
On 2014-06-12 13:58:31 +0200, Jochem van Dieten wrote: But the obvious way to fix the JDBC issue is not to fix it by adding a 'mini parser' on the JDBC side, but to make SELECT ... RETURNING PRIMARY KEY a regular select that silently ignores the returning clause and doesn't throw an error on

Re: [HACKERS] RETURNING PRIMARY KEY syntax extension

2014-06-12 Thread Ian Barwick
On 14/06/12 20:58, Jochem van Dieten wrote: On Thu, Jun 12, 2014 at 12:25 PM, Ian Barwick wrote: On 14/06/12 18:46, Jochem van Dieten wrote: I haven't checked the code, but I am hoping it will help with the problem where a RETURNING * is added to a statement that is not an

Re: [HACKERS] API change advice: Passing plan invalidation info from the rewriter into the planner?

2014-06-12 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: Even aside from security exposures, how does a non-superuser who runs pg_dump know whether they've got a complete backup or a filtered dump that's missing some rows? This seems to me to be a killer objection to the feature as proposed, and points out a

Re: [HACKERS] Shared memory changes in 9.4?

2014-06-12 Thread Christoph Berg
Re: Andres Freund 2014-06-12 20140612094112.gz8...@alap3.anarazel.de * Make initdb determine the best shm type for this platform and write it into postgresql.conf as it does now. * If no dynamic_shared_memory_type is found in the config, default to none. * Modify the three identical

Re: [HACKERS] replication commands and log_statements

2014-06-12 Thread Robert Haas
On Wed, Jun 11, 2014 at 7:42 AM, Magnus Hagander mag...@hagander.net wrote: Replication commands like IDENTIFY_COMMAND are not logged even when log_statements is set to all. Some users who use log_statements to audit *all* statements might dislike this current situation. So I'm thinking to

Re: [HACKERS] postgresql.auto.conf read from wrong directory

2014-06-12 Thread Fujii Masao
On Tue, May 27, 2014 at 2:05 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Sun, May 11, 2014 at 11:23 PM, Tom Lane t...@sss.pgh.pa.us wrote: I think it's clearly *necessary* to forbid setting data_directory in postgresql.auto.conf. The file is defined to be found in the data directory, so

Re: [HACKERS] Few observations in replication slots related code

2014-06-12 Thread Amit Kapila
On Thu, Jun 12, 2014 at 5:02 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-06-12 09:15:08 +0200, Andres Freund wrote: 6. elog(ERROR, cannot handle changeset extraction yet); Shouldn't it be better to use logical replication instead of changeset extraction? Will

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Tom Lane
Noah Misch n...@leadboat.com writes: lo_new() or lo_make()? An earlier draft of the patch that added lo_create(oid, bytea) had a similar function named make_lo(). It appears that lo_make() has a small plurality, but before we lock that name in, there was one other idea that occurred to me: the

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Andres Freund
On 2014-06-12 10:48:01 -0400, Tom Lane wrote: Noah Misch n...@leadboat.com writes: lo_new() or lo_make()? An earlier draft of the patch that added lo_create(oid, bytea) had a similar function named make_lo(). It appears that lo_make() has a small plurality, but before we lock that name

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Alvaro Herrera
Tom Lane wrote: Noah Misch n...@leadboat.com writes: lo_new() or lo_make()? An earlier draft of the patch that added lo_create(oid, bytea) had a similar function named make_lo(). It appears that lo_make() has a small plurality, but before we lock that name in, there was one other idea

Re: [HACKERS] Shared memory changes in 9.4?

2014-06-12 Thread Robert Haas
On Thu, Jun 12, 2014 at 5:41 AM, Andres Freund and...@2ndquadrant.com wrote: With regard to Andres' proposal, I'm not that keen on setting dynamic_shared_memory_type='none' by default. Note that I'm not proposing to disable the whole thing. Just that a unset dynamic_shared_memory_type

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Robert Haas
On Thu, Jun 12, 2014 at 10:56 AM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Tom Lane wrote: Noah Misch n...@leadboat.com writes: lo_new() or lo_make()? An earlier draft of the patch that added lo_create(oid, bytea) had a similar function named make_lo(). It appears that lo_make() has

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: Any other votes out there? I was also going to suggest lo_create_bytea(). Another similar possibility would be lo_from_bytea() -- or, since we have overloading (and we can actually use it in this case without breaking libpq),

Re: [HACKERS] Suppressing unused subquery output columns

2014-06-12 Thread Robert Haas
On Thu, Jun 5, 2014 at 10:27 PM, Tom Lane t...@sss.pgh.pa.us wrote: The attached draft patch fixes this by deleting unused output expressions from unflattened subqueries, so that we get: regression=# explain select f1 from (select * from t1 left join t2 on f1=f2 limit 1) ss;

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Pavel Stehule
Lo_from_bytea sounds me better than lo_create_bytea

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Presumably we should also fix libpq to not be so dumb. I mean, it doesn't help with the immediate problem, since as you say there could be non-upgraded copies of libpq out there for the indefinite future, but it still seems like something we oughta

Re: [HACKERS] Shared memory changes in 9.4?

2014-06-12 Thread Andres Freund
Hi, On 2014-06-12 11:08:35 -0400, Robert Haas wrote: On Thu, Jun 12, 2014 at 5:41 AM, Andres Freund and...@2ndquadrant.com wrote: With regard to Andres' proposal, I'm not that keen on setting dynamic_shared_memory_type='none' by default. Note that I'm not proposing to disable the whole

Re: [HACKERS] Suppressing unused subquery output columns

2014-06-12 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Thu, Jun 5, 2014 at 10:27 PM, Tom Lane t...@sss.pgh.pa.us wrote: The attached draft patch fixes this by deleting unused output expressions from unflattened subqueries, so that we get: ... I'm not entirely convinced that it's worth the extra

Re: [HACKERS] B-Tree support function number 3 (strxfrm() optimization)

2014-06-12 Thread Robert Haas
On Thu, Jun 5, 2014 at 8:37 PM, Peter Geoghegan p...@heroku.com wrote: * A configure AC_TRY_RUN tests the suitability of the system strxfrm() implementation for the purposes of this optimization. There can be no header bytes (people at pgCon reported redundant bytes on the Mac OSX

Re: [HACKERS] Proposing pg_hibernate

2014-06-12 Thread Robert Haas
On Thu, Jun 12, 2014 at 12:17 AM, Gurjeet Singh gurj...@singh.im wrote: On Wed, Jun 11, 2014 at 10:56 AM, Robert Haas robertmh...@gmail.com wrote: On Tue, Jun 10, 2014 at 10:03 PM, Gurjeet Singh gurj...@singh.im wrote: And it's probably accepted by now that such a bahviour is not catastrophic,

refactoring allpaths.c (was Re: [HACKERS] Suppressing unused subquery output columns)

2014-06-12 Thread Tom Lane
I wrote: We have a couple votes for this patch and no one has spoken against it, so I'll go ahead and push it into HEAD. BTW, I forgot to mention that while working on this patch I was thinking it's past time to separate out the subquery support in allpaths.c into its own file. With this

Re: [HACKERS] B-Tree support function number 3 (strxfrm() optimization)

2014-06-12 Thread Claudio Freire
On Thu, Jun 12, 2014 at 1:25 PM, Robert Haas robertmh...@gmail.com wrote: It appears that any string starting with the letter a will create output that begins with 001S00 and the seventh character always appears to be 0 or 1: [rhaas ~]$ ./strxfrm en_US ab ac ad ae af a% a0 a ab -

[HACKERS] add line number as prompt option to psql

2014-06-12 Thread Sawada Masahiko
Hi all, The attached IWP patch is one prompt option for psql, which shows current line number. If the user made syntax error with too long SQL then psql outputs message as following. ERROR: syntax error at or near a LINE 250: hoge ^ psql teaches me where syntax error is

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Tom Lane
I wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: I was also going to suggest lo_create_bytea(). Another similar possibility would be lo_from_bytea() -- or, since we have overloading (and we can actually use it in this case without breaking libpq), we could just have lo_from(oid,

Re: [HACKERS] [GENERAL] Question about partial functional indexes and the query planner

2014-06-12 Thread Keith Fiske
On Wed, Jun 11, 2014 at 7:24 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Tue, Jun 10, 2014 at 7:19 PM, Tom Lane t...@sss.pgh.pa.us wrote: Given the lack of previous complaints, I'm not sure this amounts to a back-patchable bug, but it does seem like

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Noah Misch
On Thu, Jun 12, 2014 at 01:53:19PM -0400, Tom Lane wrote: Since the discussion seems to have trailed off, I'm going to run with lo_from_bytea(). The plan is: 1. Rename the function. 2. Add an opr_sanity regression test memorializing what we should get from lo_initialize()'s query. 3. Make

Re: [HACKERS] updated emacs configuration

2014-06-12 Thread Noah Misch
On Tue, Jun 10, 2014 at 10:36:07AM -0400, Tom Lane wrote: Noah Misch n...@leadboat.com writes: On Mon, Jun 09, 2014 at 09:04:02PM -0400, Peter Eisentraut wrote: I'd consider just getting rid of the (c-file-style . bsd) setting in .dir-locals.el and put the actual interesting

Re: [HACKERS] make check For Extensions

2014-06-12 Thread Fabien COELHO
Andres said during the unconference last month that there was a way to get `make check` to work with PGXS. The idea is that it would initialize a temporary cluster, start it on an open port, install an extension, and run the extension's test suite. I think the pg_regress --temp-install,

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Tom Lane
Noah Misch n...@leadboat.com writes: On Thu, Jun 12, 2014 at 01:53:19PM -0400, Tom Lane wrote: It'd be a good thing if the TAP tests for client programs included testing of pg_dump/pg_restore, but that's a bit beyond my competence with that tool ... anyone care to step up? The pg_upgrade

Re: [HACKERS] make check For Extensions

2014-06-12 Thread David E. Wheeler
On Jun 12, 2014, at 11:28 AM, Fabien COELHO coe...@cri.ensmp.fr wrote: My 0.02€: It is expected to work, more or less, see the end of http://www.postgresql.org/docs/9.3/static/extend-pgxs.html That says: “The scripts listed in the REGRESS variable are used for regression testing of your

Re: [HACKERS] /proc/self/oom_adj is deprecated in newer Linux kernels

2014-06-12 Thread Gurjeet Singh
On Tue, Jun 10, 2014 at 12:05 PM, Tom Lane t...@sss.pgh.pa.us wrote: If we're going to do this, I would say that we should also take the opportunity to get out from under the question of which kernel API we're dealing with. So perhaps a design like this: 1. If the environment variable

[HACKERS] Crash on backend exit w/ OpenLDAP [2.4.24, 2.4.31]

2014-06-12 Thread Noah Misch
With LDAP support enabled, we link the backend with libldap, and we link libpq with libldap_r. Modules like dblink and postgres_fdw link to libpq, so loading them results in a backend having both libldap and libdap_r loaded. Those libraries export the same symbols, and the load order rule gives

Re: [HACKERS] B-Tree support function number 3 (strxfrm() optimization)

2014-06-12 Thread Tom Lane
Peter Geoghegan p...@heroku.com writes: ... In any case it's pretty clear that a goal of the glibc implementation is to concentrate as much entropy as possible into the first part of the string, and that's the important point. This makes perfect sense, and is why I was so incredulous about the

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Noah Misch
On Thu, Jun 12, 2014 at 02:53:23PM -0400, Tom Lane wrote: Noah Misch n...@leadboat.com writes: On Thu, Jun 12, 2014 at 01:53:19PM -0400, Tom Lane wrote: It'd be a good thing if the TAP tests for client programs included testing of pg_dump/pg_restore, but that's a bit beyond my competence

Re: [HACKERS] B-Tree support function number 3 (strxfrm() optimization)

2014-06-12 Thread Peter Geoghegan
Thanks for looking into this. On Thu, Jun 12, 2014 at 9:25 AM, Robert Haas robertmh...@gmail.com wrote: Still, it's fair to say that on this Linux system, the first 8 bytes capture a significant portion of the entropy of the first 8 bytes of the string, whereas on MacOS X you only get entropy

Re: [HACKERS] API change advice: Passing plan invalidation info from the rewriter into the planner?

2014-06-12 Thread Gregory Smith
On 6/11/14, 10:26 AM, Robert Haas wrote: Now, as soon as we introduce the concept that selecting from a table might not really mean read from the table but read from the table after applying this owner-specified qual, we're opening up a whole new set of attack surfaces. Every pg_dump is an

[HACKERS] How to change the pgsql source code and build it??

2014-06-12 Thread Shreesha
Hello, I need to initialize the db as the root and start the database server. In order to accomplish this, I modified the initdb.c source file of pgsql package and tried to compile it. Eventhough the build was successful, I couldn't see the root user able to execute initdb executable generated by

Re: [HACKERS] API change advice: Passing plan invalidation info from the rewriter into the planner?

2014-06-12 Thread Stephen Frost
Greg, all, I will reply to the emails in detail when I get a chance but am out of town at a funeral, so it'll likely be delayed. I did want to echo my agreement for the most part with Greg and in particular... On Thursday, June 12, 2014, Gregory Smith gregsmithpg...@gmail.com wrote: On

Re: [HACKERS] How to change the pgsql source code and build it??

2014-06-12 Thread Abhijit Menon-Sen
At 2014-06-12 16:08:05 -0700, shreesha1...@gmail.com wrote: I need to initialize the db as the root and start the database server. Why? -- Abhijit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] How to change the pgsql source code and build it??

2014-06-12 Thread Shreesha
I need to port pgsql onto a controller which doesn't have a framework of creating multiple users for administrative purposes. The entire controller is managed by a single root user and that is the reason I am trying to change the pgsql initdb behavior. Do you think of any other better alternative?

Re: [HACKERS] How to change the pgsql source code and build it??

2014-06-12 Thread Kyotaro HORIGUCHI
Hi, I need to port pgsql onto a controller which doesn't have a framework of creating multiple users for administrative purposes. The entire controller is managed by a single root user and that is the reason I am trying to change the pgsql initdb behavior. Do you think of any other better

Re: [HACKERS] Something flaky in the relfilenode mapping infrastructure

2014-06-12 Thread Noah Misch
On Thu, Jun 12, 2014 at 02:44:10AM -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-06-12 00:38:36 -0400, Noah Misch wrote: http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedogdt=2014-06-12%2000%3A17%3A07 Hm. My guess it's that it's just a

Re: [HACKERS] Something flaky in the relfilenode mapping infrastructure

2014-06-12 Thread Tom Lane
Noah Misch n...@leadboat.com writes: On Thu, Jun 12, 2014 at 02:44:10AM -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-06-12 00:38:36 -0400, Noah Misch wrote: http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedogdt=2014-06-12%2000%3A17%3A07 Hm. My

Re: [HACKERS] lo_create(oid, bytea) breaks every extant release of libpq

2014-06-12 Thread Tom Lane
I wrote: Robert Haas robertmh...@gmail.com writes: Presumably we should also fix libpq to not be so dumb. I mean, it doesn't help with the immediate problem, since as you say there could be non-upgraded copies of libpq out there for the indefinite future, but it still seems like something we

[HACKERS] unable to attach client process to postgresql server using gdb

2014-06-12 Thread Rajmohan C
hi, I am working with PostgreSQL 9.3.4 source using Eclipse IDE in ubuntu 14.04. I am facing a problem in attaching client process to postgresql server using gdb to debug. When I start the postmaster then I connect to it from client on a terminal. It works fine. Queries get responses. When I