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

2014-06-13 Thread Amit Kapila
On Thu, Jun 12, 2014 at 7:26 PM, Fujii Masao masao.fu...@gmail.com wrote: 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

Re: [HACKERS] view reloptions

2014-06-13 Thread Jaime Casanova
On Wed, Jun 11, 2014 at 2:46 PM, Alvaro Herrera alvhe...@2ndquadrant.com 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

[HACKERS] loading .so file at run time

2014-06-13 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] make check For Extensions

2014-06-13 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

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

2014-06-13 Thread Dean Rasheed
On 13 June 2014 01:13, Stephen Frost sfr...@snowman.net wrote: 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

Re: [HACKERS] loading .so file at run time

2014-06-13 Thread Michael Paquier
On Fri, Jun 13, 2014 at 3:29 PM, Rajmohan C csrajmo...@gmail.com wrote: 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

[HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Quan Zongliang
Hi all, Please find the attachment. By my friend asking, for convenience, support to define multi variables in single PL/pgSQL line. Like this: CREATE OR REPLACE FUNCTION try_mutlivardef() RETURNS text AS $$ DECLARE local_a, local_b, local_c text := 'a1'; BEGIN return local_a || local_b

Re: [HACKERS] pg_xlogdump --stats

2014-06-13 Thread Abhijit Menon-Sen
At 2014-06-10 18:04:13 +0900, furu...@pm.nttdata.co.jp wrote: The function works fine. It is a good to the learning of PostgreSQL. Thanks for having a look. pg_xlogdump.c: In function ‘XLogDumpStatsRow’: pg_xlogdump.c:851: warning: format ‘%20llu’ expects type ‘long long unsigned int’, but

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

2014-06-13 Thread Amit Kapila
On Thu, Jun 12, 2014 at 12:45 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-06-12 08:55:59 +0530, Amit Kapila wrote: Function pg_create_logical_replication_slot() is trying to save slot twice once during CreateInitDecodingContext() and then in ReplicationSlotPersist(), isn't it

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Pavel Stehule
Hello + it is natural in almost all languages including ADA - it increases a distance between PL/pgSQL and PL/SQL I am don't think, so this feature is necessary, but I am not against it. Regards Pavel 2014-06-13 9:20 GMT+02:00 Quan Zongliang quanzongli...@gmail.com: Hi all, Please find

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Michael Paquier
On Fri, Jun 13, 2014 at 4:20 PM, Quan Zongliang quanzongli...@gmail.com wrote: By my friend asking, for convenience, support to define multi variables in single PL/pgSQL line. Like this: CREATE OR REPLACE FUNCTION try_mutlivardef() RETURNS text AS $$ DECLARE local_a, local_b, local_c text

[HACKERS] Use unique index for longer pathkeys.

2014-06-13 Thread Kyotaro HORIGUCHI
Hello, This is the continuation from the last CF. This patch intends to make PG to use index for longer pathkeys than index columns when, - The index is a unique index. - All index columns are NOT NULL. - The index column list is a subset of query_pathkeys. The use cases for this patch are,

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Ian Barwick
Hi On 14/06/13 16:20, Quan Zongliang wrote: Hi all, Please find the attachment. By my friend asking, for convenience, support to define multi variables in single PL/pgSQL line. Like this: CREATE OR REPLACE FUNCTION try_mutlivardef() RETURNS text AS $$ DECLARE local_a, local_b,

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Pavel Stehule
2014-06-13 9:41 GMT+02:00 Michael Paquier michael.paqu...@gmail.com: On Fri, Jun 13, 2014 at 4:20 PM, Quan Zongliang quanzongli...@gmail.com wrote: By my friend asking, for convenience, support to define multi variables in single PL/pgSQL line. Like this: CREATE OR REPLACE FUNCTION

Re: [HACKERS] WAL replay bugs

2014-06-13 Thread Heikki Linnakangas
On 06/13/2014 10:14 AM, Michael Paquier wrote: On Mon, Jun 2, 2014 at 9:55 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Wed, Apr 23, 2014 at 9:43 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: Perhaps there are parts of what is proposed here that could be made more

Re: [HACKERS] WAL replay bugs

2014-06-13 Thread Michael Paquier
On Fri, Jun 13, 2014 at 4:48 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 06/13/2014 10:14 AM, Michael Paquier wrote: On Mon, Jun 2, 2014 at 9:55 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Wed, Apr 23, 2014 at 9:43 PM, Heikki Linnakangas hlinnakan...@vmware.com

Re: [HACKERS] WAL replay bugs

2014-06-13 Thread Michael Paquier
On Fri, Jun 13, 2014 at 4:50 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Fri, Jun 13, 2014 at 4:48 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 06/13/2014 10:14 AM, Michael Paquier wrote: On Mon, Jun 2, 2014 at 9:55 PM, Michael Paquier michael.paqu...@gmail.com wrote:

[HACKERS] pg_resetxlog to clear backup start/end locations.

2014-06-13 Thread Kyotaro HORIGUCHI
Hello, this is a patch that add the function to clear backup location information to pg_resetxlog. As per the discussion held before, this function cannot be back patched to the older versions than 9.4. And it also slipped over 9.4 so proposed in this CF. This simplly erases the backup location

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Quan Zongliang
On 06/13/2014 03:42 PM, Ian Barwick wrote: Hi On 14/06/13 16:20, Quan Zongliang wrote: Hi all, Please find the attachment. By my friend asking, for convenience, support to define multi variables in single PL/pgSQL line. Like this: CREATE OR REPLACE FUNCTION try_mutlivardef() RETURNS text

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

2014-06-13 Thread Andres Freund
On 2014-06-13 13:01:59 +0530, Amit Kapila wrote: On Thu, Jun 12, 2014 at 12:45 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-06-12 08:55:59 +0530, Amit Kapila wrote: Function pg_create_logical_replication_slot() is trying to save slot twice once during

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Michael Paquier
On Fri, Jun 13, 2014 at 4:43 PM, Pavel Stehule pavel.steh...@gmail.com wrote: 2014-06-13 9:41 GMT+02:00 Michael Paquier michael.paqu...@gmail.com: On Fri, Jun 13, 2014 at 4:20 PM, Quan Zongliang quanzongli...@gmail.com wrote: By my friend asking, for convenience, support to define multi

[HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-06-13 Thread Abhijit Menon-Sen
nbtxlog.c:btree_xlog_vacuum() contains the following comment: * XXX we don't actually need to read the block, we just need to * confirm it is unpinned. If we had a special call into the * buffer manager we could optimise this so that if the block is * not in shared_buffers we

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

2014-06-13 Thread Amit Kapila
On Fri, Jun 13, 2014 at 1:45 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-06-13 13:01:59 +0530, Amit Kapila wrote: Okay, but if it crashes before saving the persistency to permanent file and there remains a .tmp for this replication slot which it created during save of this

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

2014-06-13 Thread Andres Freund
On 2014-06-13 14:21:33 +0530, Amit Kapila wrote: On Fri, Jun 13, 2014 at 1:45 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-06-13 13:01:59 +0530, Amit Kapila wrote: Okay, but if it crashes before saving the persistency to permanent file and there remains a .tmp for this

[HACKERS] Quantify small changes to predicate evaluation

2014-06-13 Thread Dennis Butterstein
Hello everybody, I am currently trying to squeeze some performance out of the current predicate evaluation implementation. In fact I was able to get some positive results. I have some more points on my developement plan, but I am facing the problem that theses changes will only help very little

Re: [HACKERS] Quantify small changes to predicate evaluation

2014-06-13 Thread Marti Raudsepp
On Fri, Jun 13, 2014 at 12:46 PM, Dennis Butterstein soullinu...@web.de wrote: I expect my current changes to be resposible for about 0.2-0.3s for this query but because of the huge time differences I am not able to quantify my changes. Maybe somebody can tell me about a better approach to

Re: [HACKERS] pg_resetxlog to clear backup start/end locations.

2014-06-13 Thread Fujii Masao
On Fri, Jun 13, 2014 at 5:08 PM, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp wrote: Hello, this is a patch that add the function to clear backup location information to pg_resetxlog. As per the discussion held before, this function cannot be back patched to the older versions than 9.4.

[HACKERS] rm_desc signature

2014-06-13 Thread Heikki Linnakangas
As part of the WAL-format changing patch I've been working on, I changed the signature of the rm_desc function from: void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec); void (*rm_desc) (StringInfo buf, XLogRecord *record); The WAL-format patch needed that because it added more

Re: [HACKERS] rm_desc signature

2014-06-13 Thread Andres Freund
On 2014-06-13 14:37:33 +0300, Heikki Linnakangas wrote: As part of the WAL-format changing patch I've been working on, I changed the signature of the rm_desc function from: void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec); void (*rm_desc) (StringInfo buf, XLogRecord *record);

Re: [HACKERS] rm_desc signature

2014-06-13 Thread Fujii Masao
On Fri, Jun 13, 2014 at 8:39 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-06-13 14:37:33 +0300, Heikki Linnakangas wrote: As part of the WAL-format changing patch I've been working on, I changed the signature of the rm_desc function from: void (*rm_desc) (StringInfo buf, uint8

Re: [HACKERS] rm_desc signature

2014-06-13 Thread Abhijit Menon-Sen
At 2014-06-13 13:39:58 +0200, and...@2ndquadrant.com wrote: void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec); void (*rm_desc) (StringInfo buf, XLogRecord *record); […] +1. I've found this annoying in the past. I like it too. I was just moving some code from pg_xlogdump into

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Tom Lane
Quan Zongliang quanzongli...@gmail.com writes: CREATE OR REPLACE FUNCTION try_mutlivardef() RETURNS text AS $$ DECLARE local_a, local_b, local_c text := 'a1'; BEGIN return local_a || local_b || local_c; end; $$ LANGUAGE plpgsql; This does not seem like a terribly good idea from here.

Re: [HACKERS] Audit of logout

2014-06-13 Thread Fujii Masao
On Thu, Jun 12, 2014 at 8:51 PM, Fujii Masao masao.fu...@gmail.com wrote: 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

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Pavel Stehule
We can disallow custom initialization when when variables are declared as list. Quan' example is 100% valid in SQL/PSM and what I read about ADA then in ADA too. Regards Pavel 2014-06-13 16:04 GMT+02:00 Tom Lane t...@sss.pgh.pa.us: Quan Zongliang quanzongli...@gmail.com writes: CREATE OR

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Andres Freund
On 2014-06-13 16:12:36 +0200, Pavel Stehule wrote: Quan' example is 100% valid in SQL/PSM and what I read about ADA then in ADA too. So what? plpgsql is neither language and this doesn't seem to be the way to make them actually closer (which I doubt would be a good idea in the first place).

Re: [HACKERS] Audit of logout

2014-06-13 Thread Tom Lane
Fujii Masao masao.fu...@gmail.com writes: On Thu, Jun 12, 2014 at 8:51 PM, Fujii Masao masao.fu...@gmail.com wrote: 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.

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Pavel Stehule
2014-06-13 16:17 GMT+02:00 Andres Freund and...@2ndquadrant.com: On 2014-06-13 16:12:36 +0200, Pavel Stehule wrote: Quan' example is 100% valid in SQL/PSM and what I read about ADA then in ADA too. So what? plpgsql is neither language and this doesn't seem to be the way to make them

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-06-13 16:12:36 +0200, Pavel Stehule wrote: Quan' example is 100% valid in SQL/PSM and what I read about ADA then in ADA too. So what? plpgsql is neither language and this doesn't seem to be the way to make them actually closer (which I

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread David G Johnston
Tom Lane-2 wrote Andres Freund lt; andres@ gt; writes: On 2014-06-13 16:12:36 +0200, Pavel Stehule wrote: Quan' example is 100% valid in SQL/PSM and what I read about ADA then in ADA too. So what? plpgsql is neither language and this doesn't seem to be the way to make them actually

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Tom Lane
David G Johnston david.g.johns...@gmail.com writes: Tom Lane-2 wrote At the very least I think we should stay away from this syntax until the SQL committee understand it better than they evidently do today. I don't want to implement it and then get caught by a future clarification that

Re: [HACKERS] make check For Extensions

2014-06-13 Thread David E. Wheeler
On Jun 12, 2014, at 11:40 PM, Fabien COELHO coe...@cri.ensmp.fr wrote: I would suggest to add that to https://wiki.postgresql.org/wiki/Todo. I may look into it when I have time, over the summer. The key point is that there is no need for a temporary installation, but only of a temporary

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Alvaro Herrera
Quan Zongliang wrote: Hi all, Please find the attachment. By my friend asking, for convenience, support to define multi variables in single PL/pgSQL line. Like this: CREATE OR REPLACE FUNCTION try_mutlivardef() RETURNS text AS $$ DECLARE local_a, local_b, local_c text := 'a1';

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread Pavel Stehule
2014-06-13 17:32 GMT+02:00 Tom Lane t...@sss.pgh.pa.us: David G Johnston david.g.johns...@gmail.com writes: Tom Lane-2 wrote At the very least I think we should stay away from this syntax until the SQL committee understand it better than they evidently do today. I don't want to implement

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread David Johnston
On Fri, Jun 13, 2014 at 11:32 AM, Tom Lane t...@sss.pgh.pa.us wrote: David G Johnston david.g.johns...@gmail.com writes: Tom Lane-2 wrote At the very least I think we should stay away from this syntax until the SQL committee understand it better than they evidently do today. I don't want

Re: [HACKERS] Audit of logout

2014-06-13 Thread David G Johnston
Tom Lane-2 wrote Another answer is to make both variables PGC_SIGHUP, on the grounds that it doesn't make much sense for them not to be applied system-wide; except that I think there was some idea that logging might be enabled per-user or per-database using ALTER ROLE/DATABASE. From a

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

2014-06-13 Thread Fabrízio de Royes Mello
On Thu, Jun 12, 2014 at 10:59 PM, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp wrote: 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

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

2014-06-13 Thread Tom Lane
=?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= fabriziome...@gmail.com writes: On Thu, Jun 12, 2014 at 10:59 PM, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp wrote: Try replacing these conditions with (0 geteuid() == 0) and you would see it run as root. Maybe a compile option like

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

2014-06-13 Thread Robert Haas
On Fri, Jun 13, 2014 at 1:42 AM, Rajmohan C csrajmo...@gmail.com wrote: 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

[HACKERS] Clarification of FDW API Documentation

2014-06-13 Thread Jason Petersen
I've been deep in the FDW APIs lately and have come up with a couple of questions about the [user-facing documentation][1]. # Requirement that DELETE use junk columns The bit I'm confused by is the parenthetical in this bit at the end of the section on `AddForeignUpdateTargets`: If the

Re: [HACKERS] Clarification of FDW API Documentation

2014-06-13 Thread Tom Lane
Jason Petersen ja...@citusdata.com writes: Imagine if `BeginForeignScan` set up a remote cursor and `IterateForeignScan` just fetched _one tuple at a time_ (unlike the current behavior where they are fetched in batches). The tuple would be passed to `ExecForeignDelete` (as is required), but

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

2014-06-13 Thread Shreesha
@Fabrizio de Royes Mello, Even upon making changes as per your suggestion, I could see that initdb is failing for the same reason: *** /mswitch/pgsql/bin # ./initdb -D ../data/ The files

[HACKERS] ALTER TABLESPACE MOVE command tag tweak

2014-06-13 Thread Alvaro Herrera
The ALTER TABLESPACE MOVE command affects tables, not tablespaces; and as such, I think event triggers should support that command. I'm not proposing to change event triggers at this stage, but since IMO we will want to do that in 9.5, we need it to have a different command tag than plain ALTER

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

2014-06-13 Thread Shreesha
Like Tom said, just setting the the configure option doesn't let the root user in. Looks like lot more changes are required. Tom, according to you, what do you think would be my best bet to allow the root user initialize and start the database server? Thanks, Shreesha. On Fri, Jun 13, 2014 at

Re: [HACKERS] ALTER TABLESPACE MOVE command tag tweak

2014-06-13 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: The ALTER TABLESPACE MOVE command affects tables, not tablespaces; and as such, I think event triggers should support that command. I'm not proposing to change event triggers at this stage, but since IMO we will want to do that in 9.5, we need

Re: [HACKERS] replicating DROP commands across servers

2014-06-13 Thread Alvaro Herrera
Here's a patch implementing the proposed idea. This is used in the Bidirectional Replication stuff by Simon/Andres; it works well. One thing of note is that I added output flags for normal and original, which mostly come from performDeletion flags. This let one select only such objects when

Re: [HACKERS] ALTER TABLESPACE MOVE command tag tweak

2014-06-13 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: The ALTER TABLESPACE MOVE command affects tables, not tablespaces; and as such, I think event triggers should support that command. I'm not proposing to change event triggers at this stage, but since IMO we will want to do

Re: [HACKERS] ALTER TABLESPACE MOVE command tag tweak

2014-06-13 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: The problem in this particular case is that TABLESPACE is a global object, thus not supported; but ALTER TABLESPACE MOVE is a command that modifies tables (which *are* supported), not tablespaces. ALTER TABLESPACE MOVE is a glorified ALTER

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

2014-06-13 Thread Noah Misch
On Thu, Jun 12, 2014 at 10:50:44PM -0400, Tom Lane wrote: Alternatively, we could do something like you suggest but adjust the second join so that it suppresses only rows in which mapped_oid is null *and* there's no longer a matching OID in pg_class. That would provide additional confidence

[HACKERS] Built-in binning functions

2014-06-13 Thread Petr Jelinek
Hello, here is a patch implementing varwidth_bucket (naming is up for discussion) function which does binning with variable bucket width. The use-cases are same as for width_bucket (=data analytics, mainly histograms), the difference is that width_bucket uses buckets of same width but the

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

2014-06-13 Thread Tom Lane
Noah Misch n...@leadboat.com writes: On Thu, Jun 12, 2014 at 10:50:44PM -0400, Tom Lane wrote: Alternatively, we could do something like you suggest but adjust the second join so that it suppresses only rows in which mapped_oid is null *and* there's no longer a matching OID in pg_class. That

[HACKERS] Set new system identifier using pg_resetxlog

2014-06-13 Thread Petr Jelinek
Hello, attached is a simple patch which makes it possible to change the system identifier of the cluster in pg_control. This is useful for individualization of the instance that is started on top of data directory produced by pg_basebackup - something that's helpful for logical replication