Re: [HACKERS] make check For Extensions

2014-06-12 Thread Fabien COELHO
That does not mean that it starts a new cluster on a port. It means it will test it against an existing cluster after you have installed into that cluster. Yes, that is what I was saying. It invokes "psql" which is expected to work directly. Note that there is no temporary installation, it

[HACKERS] loading .so file at run time

2014-06-12 Thread Rajmohan C
I am working with Postgresql 9.3.4 source using eclipse IDE in ubuntu 14.04. I have a library file abc.so to be loaded at run time when postgresql server starts. When I run the server with "-D /home/rajmohan/projects/TPCH_database" as argument in run configuration, I could see LOG message abc.so

Re: [HACKERS] view reloptions

2014-06-12 Thread Jaime Casanova
On Wed, Jun 11, 2014 at 2:46 PM, Alvaro Herrera wrote: > I just noticed by chance that view relations are using StdRdOptions to > allocate their reloptions. I can't find any reason for this, other than > someone failed to realize that they should instead have a struct defined > of its own, just l

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

2014-06-12 Thread Amit Kapila
On Thu, Jun 12, 2014 at 7:26 PM, Fujii Masao wrote: > > On Tue, May 27, 2014 at 2:05 PM, Amit Kapila wrote: > > On Sun, May 11, 2014 at 11:23 PM, Tom Lane wrote: > >> I think it's clearly *necessary* to forbid setting data_directory in > >> postgresql.auto.conf. The file is defined to be found

[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 ru

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

2014-06-12 Thread Tom Lane
I wrote: > Robert Haas 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 fix.

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

2014-06-12 Thread Tom Lane
Noah Misch writes: > On Thu, Jun 12, 2014 at 02:44:10AM -0400, Tom Lane wrote: >> Andres Freund writes: >>> On 2014-06-12 00:38:36 -0400, Noah Misch wrote: http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedog&dt=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 Noah Misch
On Thu, Jun 12, 2014 at 02:44:10AM -0400, Tom Lane wrote: > Andres Freund writes: > > On 2014-06-12 00:38:36 -0400, Noah Misch wrote: > >> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedog&dt=2014-06-12%2000%3A17%3A07 > > > Hm. My guess it's that it's just a 'harmless' concurrency

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] 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 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: http://www.postgresql.org/mailpref/

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 wrote: > On 6/11/14, 10:26 AM, Robert Haas

[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 t

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

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 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 t

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 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 from the first 2 >

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

2014-06-12 Thread Tom Lane
Peter Geoghegan 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 > Mac behav

[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 pr

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 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 PG_OOM_ADJUST_FILE i

Re: [HACKERS] make check For Extensions

2014-06-12 Thread David E. Wheeler
On Jun 12, 2014, at 11:28 AM, Fabien COELHO 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 module, which can b

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

2014-06-12 Thread Tom Lane
Noah Misch 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 test suite co

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, maybe

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 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 setti

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

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 wrote: > Robert Haas writes: > > On Tue, Jun 10, 2014 at 7:19 PM, Tom Lane wrote: > >> Given the lack of previous complaints, I'm not sure this amounts to > >> a back-patchable bug, but it does seem like something worth fixing > >> going forward. > > >

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

2014-06-12 Thread Tom Lane
I wrote: > Alvaro Herrera 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, bytea). > Andres al

[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 occurre

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 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" -> "001S001T001S

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 patc

Re: [HACKERS] Proposing pg_hibernate

2014-06-12 Thread Robert Haas
On Thu, Jun 12, 2014 at 12:17 AM, Gurjeet Singh wrote: > On Wed, Jun 11, 2014 at 10:56 AM, Robert Haas wrote: >> On Tue, Jun 10, 2014 at 10:03 PM, Gurjeet Singh wrote: >>> And it's probably accepted by now that such a bahviour is not >>> catastrophic, merely inconvenient. >> >> I think the whole

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 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 implementation at pgCo

Re: [HACKERS] Suppressing unused subquery output columns

2014-06-12 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 5, 2014 at 10:27 PM, Tom Lane 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 planning cycles, >> though. Given the

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 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. Ju

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

2014-06-12 Thread Tom Lane
Robert Haas 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 fix. It's been in t

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] Suppressing unused subquery output columns

2014-06-12 Thread Robert Haas
On Thu, Jun 5, 2014 at 10:27 PM, Tom Lane 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 Tom Lane
Alvaro Herrera 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), we > could just have

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 wrote: > Tom Lane wrote: >> Noah Misch 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 bef

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 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 doesn't configure d

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

2014-06-12 Thread Alvaro Herrera
Tom Lane wrote: > Noah Misch 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 occur

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 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

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

2014-06-12 Thread Tom Lane
Noah Misch 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 underlying C

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 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 change.

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 wrote: > On Sun, May 11, 2014 at 11:23 PM, Tom Lane 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 any such setting is circular logic

Re: [HACKERS] replication commands and log_statements

2014-06-12 Thread Robert Haas
On Wed, Jun 11, 2014 at 7:42 AM, Magnus Hagander 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 change log_stat

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 thr

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

2014-06-12 Thread Kevin Grittner
Robert Haas 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 huge difference be

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 no

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 o

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 r

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 real

[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] 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 backpatc

Re: [HACKERS] replication commands and log_statements

2014-06-12 Thread Fujii Masao
On Wed, Jun 11, 2014 at 11:55 PM, Tom Lane wrote: > Andres Freund 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 got to vote with the other side

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 thos

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 wi

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 column

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 > > > On Tue, May 27, 2014 at 8:22 PM, Maciek Sakrejda > > wrote: > > > On Mon, May 26, 2014 at 12:24 AM, Andres Freund > > > wrote: > > >> Any chance you're using a 9.3 configuration file instead of the one

Re: [HACKERS] Shared memory changes in 9.4?

2014-06-12 Thread Christoph Berg
[redirecting to -hackers] Re: Robert Haas 2014-05-28 > On Tue, May 27, 2014 at 8:22 PM, Maciek Sakrejda wrote: > > On Mon, May 26, 2014 at 12:24 AM, Andres Freund > > wrote: > >> Any chance you're using a 9.3 configuration file instead of the one > >> generated by initdb? > >> dynamic_shared_m

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 memor