[HACKERS] [RFC] overflow checks optimized away

2013-01-19 Thread Xi Wang
Intel's icc and PathScale's pathcc compilers optimize away several overflow checks, since they consider signed integer overflow as undefined behavior. This leads to a vulnerable binary. Currently we use -fwrapv to disable such (mis)optimizations in gcc, but not in other compilers. Examples

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-01-19 Thread Amit kapila
On Sunday, January 20, 2013 4:04 AM Dickson S. Guedes wrote: 2013/1/18 Amit kapila : >> Please find the rebased Patch for Compute MAX LSN. >The function 'remove_parent_refernces' couldn't be called >'remove_parent_references' ? Shall fix this. > Why not an extension in PGXN instead of a contrib

[HACKERS] [PATCH] Fix off-by-one in PQprintTuples()

2013-01-19 Thread Xi Wang
Don't write past the end of tborder; the size is width + 1. --- src/interfaces/libpq/fe-print.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c index 076e1cc..7ed489a 100644 --- a/src/interfaces/libpq/fe-print

[HACKERS] [PATCH] Fix NULL checking in check_TSCurrentConfig()

2013-01-19 Thread Xi Wang
The correct NULL check should use `*newval'; `newval' must be non-null. --- src/backend/utils/cache/ts_cache.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/cache/ts_cache.c b/src/backend/utils/cache/ts_cache.c index e688b1a..65a8ad7 100644 --- a/src/bac

Re: [HACKERS] logical changeset generation v4

2013-01-19 Thread Steve Singer
On 13-01-14 08:38 PM, Andres Freund wrote: Hi everyone, Here is the newest version of logical changeset generation. 2) Currently the logical replication infrastructure assigns a 'slot-id' when a new replica is setup. That slot id isn't really nice (e.g. "id-321578-3"). It also requires that [

[HACKERS]

2013-01-19 Thread wln
subscribe end

[HACKERS] pg_upgrade and system() return value

2013-01-19 Thread Bruce Momjian
Can someone comment on the attached patch? pg_upgrade was testing if system() returned a non-zero value, while I am thinking I should be adjusting system()'s return value with WEXITSTATUS(). Is there any possible bug in back branches just compariing system()'s turn value to non-zero without cal

Re: [HACKERS] Identity projection

2013-01-19 Thread Stephen Frost
Kyotaro, Are you planning to update this patch based on Heikki's comments? The patch is listed in the commitfest and we're trying to make some progress through all of those patches. Thanks, Stephen * Heikki Linnakangas (hlinn...@iki.fi) wrote: > On 12.11.2012 12:0

Re: [HACKERS] Strange Windows problem, lock_timeout test request

2013-01-19 Thread Andrew Dunstan
On 01/19/2013 02:51 AM, Boszormenyi Zoltan wrote: Yes it rings a bell. See I wanted to add a comment to this blog entry but it wasn't accepted. The blog is closed for comments. I

Re: [HACKERS] pg_dump transaction's read-only mode

2013-01-19 Thread Tom Lane
Pavan Deolasee writes: > Sorry for posting on such an old thread. But here is a patch that > fixes this. I'm also adding to the next commitfest so that we don't > lose track of it again. As submitted, this broke pg_dump for dumping from pre-8.0 servers. (7.4 didn't accept commas in SET TRANSACTIO

Re: [HACKERS] lazy_vacuum_heap()'s removal of HEAPTUPLE_DEAD tuples

2013-01-19 Thread Jeff Janes
On Wednesday, January 9, 2013, Noah Misch wrote: > On Thu, Jan 10, 2013 at 02:45:36AM +, Simon Riggs wrote: > > On 8 January 2013 02:49, Noah Misch > > wrote: > > > There is a bug in lazy_scan_heap()'s > > > bookkeeping for the xid to place in that WAL record. Each call to > > > heap_page_pru

Re: [HACKERS] ALTER command reworks

2013-01-19 Thread Kohei KaiGai
2013/1/17 Alvaro Herrera : > Kohei KaiGai escribió: > >> This attached patch is the rebased one towards the latest master branch. > > Great, thanks. I played with it a bit and it looks almost done to me. > The only issue I can find is that it lets you rename an aggregate by > using ALTER FUNCTION,

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-01-19 Thread Dickson S. Guedes
2013/1/18 Amit kapila : > Please find the rebased Patch for Compute MAX LSN. The function 'remove_parent_refernces' couldn't be called 'remove_parent_references' ? Why not an extension in PGXN instead of a contrib? Regards, -- Dickson S. Guedes mail/xmpp: gue...@guedesoft.net - skype: guediz ht

Re: [HACKERS] Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)

2013-01-19 Thread Steve Singer
On 13-01-09 03:07 PM, Tom Lane wrote: Andres Freund writes: Well, I *did* benchmark it as noted elsewhere in the thread, but thats obviously just machine (E5520 x 2) with one rather restricted workload (pgbench -S -jc 40 -T60). At least its rather palloc heavy. Here are the numbers: before: #10

Re: [HACKERS] string escaping in tutorial/syscat.source

2013-01-19 Thread Tom Lane
Josh Kupershmidt writes: > It seems the queries in ./src/tutorial/syscat.source use string > escaping with the assumption that standard_conforming_strings is off, > and thus give wrong results with modern versions. A simple fix is > attached. I tweaked the comments a little bit and committed this

Re: [HACKERS] CF3+4 (was Re: Parallel query execution)

2013-01-19 Thread Jeff Janes
On Thursday, January 17, 2013, Magnus Hagander wrote: > > > > Would it help to step up a few developers and create a second line of > > committers ? The commits by the second line committers will still be > > reviewed by the first line committers before they make into the product, > but > > may b

Re: [HACKERS] proposal: fix corner use case of variadic fuctions usage

2013-01-19 Thread Pavel Stehule
2013/1/19 Tom Lane : > Pavel Stehule writes: >> 2013/1/18 Tom Lane : >>> The approach is also inherently seriously inefficient. ... > >> What is important - for this use case - there is simple and perfect >> possible optimization - in this case "non variadic manner call of >> variadic "any" functi

[HACKERS] Re: Doc patch making firm recommendation for setting the value of commit_delay

2013-01-19 Thread Noah Misch
On Wed, Nov 14, 2012 at 08:44:26PM +, Peter Geoghegan wrote: > http://commit-delay-results-ssd-insert.staticloud.com > http://commit-delay-stripe-insert.staticloud.com > http://commit-delay-results-stripe-tpcb.staticloud.com > http://commit-delay-results-ssd-insert.staticloud.com/19/pg_settings

Re: [HACKERS] Query to help in debugging

2013-01-19 Thread Bruce Momjian
On Sat, Jan 19, 2013 at 03:29:36PM -0500, Tom Lane wrote: > Bruce Momjian writes: > >> Tom Lane wrote: > >>> select name, setting, source from pg_settings > >>> where source not in ('default', 'override'); > > > Here is my very wide output: > > Why are you insisting on cramming version() into th

Re: [HACKERS] Query to help in debugging

2013-01-19 Thread Tom Lane
Bruce Momjian writes: >> Tom Lane wrote: >>> select name, setting, source from pg_settings >>> where source not in ('default', 'override'); > Here is my very wide output: Why are you insisting on cramming version() into this? It could just as easily be a different query.

Re: [HACKERS] proposal: fix corner use case of variadic fuctions usage

2013-01-19 Thread Tom Lane
Pavel Stehule writes: > 2013/1/18 Tom Lane : >> The approach is also inherently seriously inefficient. ... > What is important - for this use case - there is simple and perfect > possible optimization - in this case "non variadic manner call of > variadic "any" function" all variadic parameters w

Re: [HACKERS] Strange Windows problem, lock_timeout test request

2013-01-19 Thread Andrew Dunstan
On 01/19/2013 02:36 AM, Boszormenyi Zoltan wrote: Cross-compiling is not really a supported platform. Why don't you just build natively? This is know to work as shown by the buildfarm animals doing it successfully. Because I don't have a mingw setup on Windows. (Sorry.) A long time ago

Re: [HACKERS] Passing connection string to pg_basebackup

2013-01-19 Thread Dimitri Fontaine
Tom Lane writes: > I don't think that argument holds any water at all. There would still > be differences in command line argument capabilities out there --- > they'd just be between minor versions not major ones. That's not any > easier for people to deal with. And what will you say to someone

Re: [HACKERS] proposal: fix corner use case of variadic fuctions usage

2013-01-19 Thread Pavel Stehule
2013/1/19 Stephen Frost : > Pavel, > > While I certainly appreciate your enthusiasm, I don't think this is > going to make it into 9.3, which is what we're currently focused on. > > I'd suggest that you put together a wiki page or similar which > outlines how this is going to work and be im

Re: [HACKERS] Query to help in debugging

2013-01-19 Thread Bruce Momjian
On Sat, Jan 19, 2013 at 12:58:35PM -0500, Kevin Grittner wrote: > Tom Lane wrote: > > > I find the manual exclusion list to be poor style, and not at all > > future-proof. Maybe we could use > > > > select name, setting, source from pg_settings > > where source not in ('default', 'override'); > >

Re: [HACKERS] proposal: fix corner use case of variadic fuctions usage

2013-01-19 Thread Stephen Frost
Pavel, While I certainly appreciate your enthusiasm, I don't think this is going to make it into 9.3, which is what we're currently focused on. I'd suggest that you put together a wiki page or similar which outlines how this is going to work and be implemented and it can be discussed fo

Re: [HACKERS] My first patch! (to \df output)

2013-01-19 Thread Stephen Frost
* Phil Sorber (p...@omniti.com) wrote: > Stephen, I think Jon's column name and values make a lot of sense. a'ight. I can't think of anything better. Thanks, Stephen signature.asc Description: Digital signature

Re: [HACKERS] could not create directory "...": File exists

2013-01-19 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > I committed this with a couple of changes: Great, thanks! > * I used GetLatestSnapshot rather than GetTransactionSnapshot. Since > we don't allow these operations inside transaction blocks, there > shouldn't be much difference, but in principle GetTransac

Re: [HACKERS] proposal: fix corner use case of variadic fuctions usage

2013-01-19 Thread Pavel Stehule
Hello 2013/1/18 Tom Lane : > Stephen Frost writes: >> [ quick review of patch ] > > On reflection it seems to me that this is probably not a very good > approach overall. Our general theory for functions taking ANY has > been that the core system just computes the arguments and leaves it > to th

Re: [HACKERS] Query to help in debugging

2013-01-19 Thread Kevin Grittner
Tom Lane wrote: > I find the manual exclusion list to be poor style, and not at all > future-proof. Maybe we could use > > select name, setting, source from pg_settings > where source not in ('default', 'override'); > > This would print a few not-all-that-interesting settings made by initdb, > b

Re: [HACKERS] Passing connection string to pg_basebackup

2013-01-19 Thread Tom Lane
Dimitri Fontaine writes: > On the other hand, discrepancies in between command line arguments > processing in our tools are already not helping our users (even if > pg_dump -d seems to have been fixed along the years); so much so that > I'm having a hard time finding any upside into having a diffe

Re: [HACKERS] Passing connection string to pg_basebackup

2013-01-19 Thread Dimitri Fontaine
Magnus Hagander writes: >> FWIW, +1. I would consider it a bugfix (backpatch, etc). > > While it's a feature I'd very much like to see, I really don't think > you can consider it a bugfix. It's functionality that was left out - > it's not like we tried to implement it and it didn't work. We pushed

Re: [HACKERS] My first patch! (to \df output)

2013-01-19 Thread Phil Sorber
On Jan 19, 2013 10:55 AM, "Jon Erdman" wrote: > > > I did realize that since I moved it to + the doc should change, but I didn't address that. I'll get on it this weekend. > > As far as the column name and displayed values go, they're taken from the CREATE FUNCTION syntax, and were recommended by

Re: [HACKERS] proposal: fix corner use case of variadic fuctions usage

2013-01-19 Thread Pavel Stehule
Hello I try to recapitulate our design of variadic functions (sorry for my English - really I have plan to learn this language better - missing time). We have two kinds of VARG functions: VARIADIC "any" and VARIADIC anyarray. These kinds are really different although it is transparent for final u

Re: [HACKERS] Contrib PROGRAM problem

2013-01-19 Thread Tom Lane
Andrew Dunstan writes: > *sigh*. Don't post after midnight. Of course, this isn't relevant to a > cross-compiling environment, where repeated invocations of make > repeatedly build the executables. > The question is whether we care enough about this case to fix it. I think we certainly need th

Re: [HACKERS] Query to help in debugging

2013-01-19 Thread Tom Lane
Bruce Momjian writes: > I am wondering if we should make this query more widely used, perhaps by > putting it in our docs about reporting bugs, or on our website. I find the manual exclusion list to be poor style, and not at all future-proof. Maybe we could use select name, setting, source from

Re: [HACKERS] Query to help in debugging

2013-01-19 Thread Bruce Momjian
On Sat, Jan 19, 2013 at 11:20:19AM -0500, Kevin Grittner wrote: > Bruce Momjian wrote: > > > I am wondering if we should make this query more widely used, perhaps by > > putting it in our docs about reporting bugs, or on our website. > > http://wiki.postgresql.org/wiki/Server_Configuration > > h

Re: [HACKERS] Query to help in debugging

2013-01-19 Thread Kevin Grittner
Bruce Momjian wrote: > I am wondering if we should make this query more widely used, perhaps by > putting it in our docs about reporting bugs, or on our website. http://wiki.postgresql.org/wiki/Server_Configuration http://wiki.postgresql.org/wiki/Guide_to_reporting_problems#Things_you_need_to_me

[HACKERS] Query to help in debugging

2013-01-19 Thread Bruce Momjian
On Fri, Jan 18, 2013 at 07:35:43AM -0800, bricklen wrote: > Please post the results of the following query: > > SELECT 'version'::text AS "name", > version() AS "current_setting" > UNION ALL > SELECT name, > current_setting(name) > FROM pg_settings > WHERE NOT source='default'AND

Re: [HACKERS] My first patch! (to \df output)

2013-01-19 Thread Jon Erdman
I did realize that since I moved it to + the doc should change, but I didn't address that. I'll get on it this weekend. As far as the column name and displayed values go, they're taken from the CREATE FUNCTION syntax, and were recommended by Magnus, Bruce, and Fetter, who were all sitting next

Re: [HACKERS] How to build contrib module separately in PostgreSQL on windows

2013-01-19 Thread Andrew Dunstan
On 01/19/2013 10:09 AM, 朱冯贶天 wrote: > Hi, > > I change some code of extension "cube" in PostgreSQL to do some > experiments. > > > The problem is that I want to make these changed code effective, and I > am not sure how to build it on windows. > > > After downloading the source code, I enter the >

[HACKERS] How to build contrib module separately in PostgreSQL on windows

2013-01-19 Thread 朱冯贶天
Hi, I change some code of extension "cube" in PostgreSQL to do some experiments. The problem is that I want to make these changed code effective, and I am not sure how to build it on windows. After downloading the source code, I enter the "postgresql-9.2.2\contrib\cube" to type 'nmake' with VS201

Re: [HACKERS] Contrib PROGRAM problem

2013-01-19 Thread Andrew Dunstan
On 01/19/2013 12:13 AM, Andrew Dunstan wrote: On 01/18/2013 11:59 PM, Peter Eisentraut wrote: The above is the way it's done everywhere else in the source tree. I think the reason this works is that either make or the system call that make uses is aware of this naming issue somehow. Oh, hm

Re: [HACKERS] allowing privileges on untrusted languages

2013-01-19 Thread Simon Riggs
On 19 January 2013 13:45, Kohei KaiGai wrote: > I think, it is a time to investigate separation of database superuser > privileges > into several fine-grained capabilities, like as operating system doing. > https://github.com/torvalds/linux/blob/master/include/uapi/linux/capability.h > > In case

Re: [HACKERS] allowing privileges on untrusted languages

2013-01-19 Thread Kohei KaiGai
2013/1/11 Peter Eisentraut : > Here is a proposed patch for the issue discussed in > : > > I'd propose getting rid of lanplistrusted, at least for access > checking. Instead, just don't install USAGE privileges by >

Re: [HACKERS] More subtle issues with cascading replication over timeline switches

2013-01-19 Thread Amit kapila
On Friday, January 18, 2013 5:27 PM Heikki Linnakangas wrote: > Indeed, looking at the pg_xlog, it's not there (I did a couple of extra > timeline switches: > ~/pgsql.master$ ls -l data-master/pg_xlog/ > total 131084 > -rw--- 1 heikki heikki 16777216 Jan 18 13:38 00010001 >

Re: [HACKERS] Passing connection string to pg_basebackup

2013-01-19 Thread Magnus Hagander
On Fri, Jan 18, 2013 at 2:43 PM, Dimitri Fontaine wrote: > Heikki Linnakangas writes: >> You could still use environment variables and a service file to do it, but >> it's certainly more cumbersome. It clearly should be possible to pass a full >> connection string to pg_basebackup, that's an obvi

Re: [HACKERS] Passing connection string to pg_basebackup

2013-01-19 Thread Magnus Hagander
On Fri, Jan 18, 2013 at 1:05 PM, Heikki Linnakangas wrote: > On 18.01.2013 13:41, Amit Kapila wrote: >> >> On Friday, January 18, 2013 3:46 PM Heikki Linnakangas wrote: >>> >>> On 18.01.2013 08:50, Amit Kapila wrote: I think currently user has no way to specify TCP keepalive settings >>>

Re: [HACKERS] foreign key locks

2013-01-19 Thread Simon Riggs
On 18 January 2013 21:01, Tom Lane wrote: > Andres Freund writes: >> On 2013-01-18 15:37:47 -0500, Tom Lane wrote: >>> I doubt it ever came up before. What use is logging only the content of >>> a buffer page? Surely you'd need to know, for example, which relation >>> and page number it is from