Re: [HACKERS] inherit support for foreign tables

2014-03-31 Thread Etsuro Fujita
(2014/03/28 13:28), Kyotaro HORIGUCHI wrote: Hmm. The assertion (not shown above but you put in parameterize_path:) seems to say that 'base relation for foreign paths must be a RTE_RELATION' isn't right? I think that's right. Please see allpaths.c, especially set_rel_pathlist(). For your info

Re: [HACKERS] separate output dirs for test decoding pieces.

2014-03-31 Thread Andres Freund
Hi, On 2014-03-29 13:20:41 -0400, Andrew Dunstan wrote: > > "make check" in contrib/test_decoding actually does two regression runs, one > with pg_regress and one with pg_isolation_regress. These both use the same > (default) outputdir, so one overwrites the other, which is a bit unfortunate > fr

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Andres Freund
Hi, On 2014-03-30 00:00:30 -0400, Stephen Frost wrote: > Greetings, > > Looks like we might not be entirely out of the woods yet regarding > MultiXactId's. After doing an upgrade from 9.2.6 to 9.3.4, we saw the > following: > > ERROR: MultiXactId 6849409 has not been created yet -- app

[HACKERS] _mdfd_getseg can be expensive

2014-03-31 Thread Andres Freund
Hi, I recently have seen some perf profiles in which _mdfd_getseg() was in the top #3 when VACUUMing large (~200GB) relations. Called by mdread(), mdwrite(). Looking at it's implementation, I am not surprised. It iterates over all segment entries a relations has; for every read or write. That's no

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

2014-03-31 Thread Thom Brown
On 31 March 2014 06:51, Peter Geoghegan wrote: > On Wed, Mar 26, 2014 at 8:08 PM, Peter Geoghegan wrote: >> The API I envisage is a new support function 3 that operator class >> authors may optionally provide. > > I've built a prototype patch, attached, that extends SortSupport and > tuplesort to

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Alvaro Herrera
Stephen Frost wrote: > * Stephen Frost (sfr...@snowman.net) wrote: > > I have the pre-upgrade database and can upgrade/rollback/etc that pretty > > easily. Note that the table contents weren't changed during the > > upgrade, of course, and so the 9.2.6 instance has HEAP_XMAX_IS_MULTI set > > while

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Andres Freund
On 2014-03-31 08:54:53 -0300, Alvaro Herrera wrote: > My conclusion here is that some part of the code is failing to examine > XMAX_INVALID before looking at the value stored in xmax itself. There > ought to be a short-circuit. Fortunately, this bug should be pretty > harmless. > > .. and after

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Alvaro Herrera
Andres Freund wrote: > On 2014-03-31 08:54:53 -0300, Alvaro Herrera wrote: > > My conclusion here is that some part of the code is failing to examine > > XMAX_INVALID before looking at the value stored in xmax itself. There > > ought to be a short-circuit. Fortunately, this bug should be pretty >

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Andres Freund
On 2014-03-31 09:19:12 -0300, Alvaro Herrera wrote: > Andres Freund wrote: > > On 2014-03-31 08:54:53 -0300, Alvaro Herrera wrote: > > > My conclusion here is that some part of the code is failing to examine > > > XMAX_INVALID before looking at the value stored in xmax itself. There > > > ought to

Re: [HACKERS] New parameter RollbackError to control rollback behavior on error

2014-03-31 Thread Michael Paquier
On Wed, Mar 26, 2014 at 5:53 PM, Heikki Linnakangas wrote: > * I'm not too fond of the RollbackError name. It sounds like "an error while > rolling back". I googled around and found out that DataDirect's proprietary > driver has the same option, and they call it TransactionErrorBehavior. See > htt

Re: [HACKERS] New parameter RollbackError to control rollback behavior on error

2014-03-31 Thread Michael Paquier
On Mon, Mar 31, 2014 at 9:40 PM, Michael Paquier wrote: > OK, I have been working more on that, giving the attached patch... Sorry, wrong mailing list... My apologies. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Alvaro Herrera
Andres Freund wrote: > On 2014-03-31 09:19:12 -0300, Alvaro Herrera wrote: > > Andres Freund wrote: > > > On 2014-03-31 08:54:53 -0300, Alvaro Herrera wrote: > > > > My conclusion here is that some part of the code is failing to examine > > > > XMAX_INVALID before looking at the value stored in xma

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Stephen Frost
* Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: > I guess I wasn't expecting that too-old values would last longer than a > full wraparound cycle. Maybe the right fix is just to have the second > check also conditional on allow_old. I don't believe this was a wraparound case. > Anyway, it's n

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Andres Freund
On 2014-03-31 09:09:08 -0400, Stephen Frost wrote: > * Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: > > I guess I wasn't expecting that too-old values would last longer than a > > full wraparound cycle. Maybe the right fix is just to have the second > > check also conditional on allow_old. >

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Stephen Frost
Andres, * Andres Freund (and...@2ndquadrant.com) wrote: > Without having looked at the code, IIRC this looks like some place > misses passing allow_old=true where it's actually required. Any chance > you can get a backtrace for the error message? I know you said somewhere > below that you'd worked

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Stephen Frost
* Andres Freund (and...@2ndquadrant.com) wrote: > On 2014-03-31 09:09:08 -0400, Stephen Frost wrote: > > * Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: > > > I guess I wasn't expecting that too-old values would last longer than a > > > full wraparound cycle. Maybe the right fix is just to have

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

2014-03-31 Thread Thom Brown
On 31 March 2014 11:32, Thom Brown wrote: > On 31 March 2014 06:51, Peter Geoghegan wrote: >> On Wed, Mar 26, 2014 at 8:08 PM, Peter Geoghegan wrote: >>> The API I envisage is a new support function 3 that operator class >>> authors may optionally provide. >> >> I've built a prototype patch, att

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Alvaro Herrera
Stephen Frost wrote: > Further review leads me to notice that both HEAP_XMAX_IS_MULTI and > HEAP_XMAX_INVALID are set: > > t_infomask | 6528 > > 6528 decimal -> 0x1980 > > 0001 1001 1000 > > Which gives us: > > 1000 - HEAP_XMAX_LOCK_ONLY > 0001 - HEAP_XMIN_

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Alvaro Herrera
Andres Freund wrote: > On 2014-03-31 08:54:53 -0300, Alvaro Herrera wrote: > > My conclusion here is that some part of the code is failing to examine > > XMAX_INVALID before looking at the value stored in xmax itself. There > > ought to be a short-circuit. Fortunately, this bug should be pretty >

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread steve k
These were my results: I'd advise anyone contemplating using this feature to seriously seriously seriously test this and exam

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Alvaro Herrera
Alvaro Herrera wrote: > Andres Freund wrote: > > On 2014-03-31 08:54:53 -0300, Alvaro Herrera wrote: > > > My conclusion here is that some part of the code is failing to examine > > > XMAX_INVALID before looking at the value stored in xmax itself. There > > > ought to be a short-circuit. Fortunat

Re: [HACKERS] MultiXactId error after upgrade to 9.3.4

2014-03-31 Thread Stephen Frost
* Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: > > I think this rule is wrong. I think the rule ought to be something like > > "if the XMAX_INVALID bit is set, then reset whatever is there if there > > is something; if the bit is not set, proceed as today". Otherwise we > > risk reading garba

Re: [HACKERS] Comment in src/backend/commands/vacuumlazy.c

2014-03-31 Thread Robert Haas
On Mon, Mar 24, 2014 at 12:28 AM, Amit Langote wrote: > Hi, > > Note the following comment in > src/backend/commands/vacuumlazy.c:lazy_scan_heap() > > 1088 /* If no indexes, make log report that lazy_vacuum_heap > would've made */ > 1089 if (vacuumed_pages) > 1090 ereport(elevel,

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

2014-03-31 Thread Heikki Linnakangas
On 03/31/2014 08:51 AM, Peter Geoghegan wrote: + #ifdef HAVE_LOCALE_T + if (tss->locale) + strxfrm_l(pres, tss->buf1, Min(sizeof(Datum), len), tss->locale); + else + #endif + strxfrm(pres, tss->buf1, Min(sizeof(Datum), len)); + + pres[Min(sizeof(Datu

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread Andrew Dunstan
On 03/31/2014 10:18 AM, steve k wrote: These were my results: I'd advise anyone contemplating using this feature to seriously s

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread steve k
Am I to understand then that I should expect no error feedback if copy fails because of something like attempting to insert alphabetic into a numeric? I apologize for my ignorance, but all my return codes were always successful (PGRES_COMMAND_OK) even if nothing was copied due to garbage data.

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread Alvaro Herrera
steve k wrote: > I am examining other ways to do mass inserts/writes that allow for > notification if some of the data contained within for some reason fails to > copy/insert so that the cause of the bad data can be examined and remedied > as soon as it occurs as well as writing the offending data

Re: [HACKERS] jsonb and nested hstore

2014-03-31 Thread Robert Haas
On Fri, Mar 14, 2014 at 9:17 PM, Josh Berkus wrote: > On 03/14/2014 06:44 PM, Tomas Vondra wrote: >> Stupid question - so if I have a json like this: > > Not a stupid question, actually. In fact, I expect to answer it 400 or > 500 times over the lifespan of 9.4. > >> { "a" : { "b" : "c"}} >> >

Re: [HACKERS] HEAD seems to generate larger WAL regarding GIN index

2014-03-31 Thread Robert Haas
On Thu, Mar 20, 2014 at 1:12 PM, Jesper Krogh wrote: > On 15/03/14 20:27, Heikki Linnakangas wrote: >> That said, I didn't expect the difference to be quite that big when you're >> appending to the end of the table. When the new entries go to the end of the >> posting lists, you only need to recom

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread David Johnston
steve k wrote > Am I to understand then that I should expect no error feedback if copy > fails because of something like attempting to insert alphabetic into a > numeric? > > I apologize for my ignorance, but all my return codes were always > successful (PGRES_COMMAND_OK) even if nothing was cop

Re: [HACKERS] About adding an attribute to a system catalog

2014-03-31 Thread Robert Haas
On Mon, Mar 24, 2014 at 6:38 PM, Tanmay Deshpande wrote: > My doubt is what changes does one have to make in the source code if he/she > is trying to add an attribute to the existing system catalogs table ? In general, you mostly need to modify the pg_whatever.h file that defines that system cata

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread steve k
Hi Alvaro, Thanks for the prompt response. PGLoader looks like an awesome project and I especially liked this part: /"Handling PostgreSQL errors Some data will get rejected by PostgreSQL, even after being carefully prepared by the transformation functions you can attach to pgloader. Then pgl

Re: [HACKERS] Fix typo in decoding always passing true for the startup callback's is_init.

2014-03-31 Thread Robert Haas
On Tue, Mar 25, 2014 at 10:46 AM, Andres Freund wrote: > I found a typo causing is_init set to be to true when it should be > false... Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@p

Re: [HACKERS] jsonb and nested hstore & VODKA

2014-03-31 Thread Josh Berkus
On 03/31/2014 09:34 AM, Robert Haas wrote: > On Fri, Mar 14, 2014 at 9:17 PM, Josh Berkus wrote: >> Precisely. Hence, the Russian plans for VODKA. > > Have these plans been shared publicly somewhere? Got a link? > Nothing other than the pgCon proposal. Presumably we'll know at pgCon, unless

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread steve k
I started with this: DBInsert_excerpts6_test_cpdlc.cpp Due to a cut and paste error I was originally querying the wrong sequence which led to me wondering why data wasn't in the table that the log repor

Re: [HACKERS] Why MarkBufferDirtyHint doesn't increment shared_blks_dirtied

2014-03-31 Thread Robert Haas
On Wed, Mar 26, 2014 at 11:23 PM, Amit Kapila wrote: > On Thu, Mar 27, 2014 at 1:39 AM, Robert Haas wrote: >> On Mon, Mar 24, 2014 at 9:02 PM, Amit Kapila wrote: >>> MarkBufferDirty() always increment BufferUsage counter >>> (shared_blks_dirtied) for dirty blocks whenever it dirties any >>> bloc

Re: [HACKERS] Cube extension kNN support

2014-03-31 Thread Sergey Konoplev
On Thu, Mar 27, 2014 at 3:26 PM, Sergey Konoplev wrote: > On Sun, Sep 22, 2013 at 4:38 PM, Stas Kelvich wrote: >> Here is the patch that introduces kNN search for cubes with euclidean, >> taxicab and chebyshev distances. > > What is the status of this patch? Referring to our private conversatio

Re: [HACKERS] trailing comment ghost-timing

2014-03-31 Thread Bruce Momjian
On Sat, Dec 28, 2013 at 08:20:59PM -0500, Tom Lane wrote: > Andres Freund writes: > > On 2013-12-24 12:27:59 -0500, Tom Lane wrote: > >> What I was proposing was that we do include comments in what we send, > >> as long as those comments are embedded in the statement text, not > >> on lines before

Re: [HACKERS] doPickSplit stack buffer overflow in XLogInsert?

2014-03-31 Thread Robert Haas
On Wed, Mar 26, 2014 at 9:45 PM, Peter Geoghegan wrote: > On Wed, Nov 27, 2013 at 9:10 AM, Noah Misch wrote: >> The threat is that rounding the read size up to the next MAXALIGN would cross >> into an unreadable memory page, resulting in a SIGSEGV. Every palloc chunk >> has MAXALIGN'd size under

Re: [HACKERS] separate output dirs for test decoding pieces.

2014-03-31 Thread Robert Haas
On Mon, Mar 31, 2014 at 5:27 AM, Andres Freund wrote: > On 2014-03-29 13:20:41 -0400, Andrew Dunstan wrote: >> "make check" in contrib/test_decoding actually does two regression runs, one >> with pg_regress and one with pg_isolation_regress. These both use the same >> (default) outputdir, so one o

Re: [HACKERS] Still something fishy in the fastpath lock stuff

2014-03-31 Thread Robert Haas
On Wed, Mar 26, 2014 at 12:59 AM, Robert Haas wrote: > It seems to me that the simplest thing to do might be > just this: > > -static FastPathStrongRelationLockData *FastPathStrongRelationLocks; > +static volatile FastPathStrongRelationLockData *FastPathStrongRelationLocks; > > Do you see any prob

Re: [HACKERS] Array of composite types returned from python

2014-03-31 Thread Behn, Edward (EBEHN)
Attached is the patch for the code change described below: Project Name : Allow return array of composites from PL/Python Currently, a SQL array of non-composite variables can be returned from PL/Python code by returning a iterable object. A SQL composite value may be returned by returning

Re: [HACKERS] About adding an attribute to a system catalog

2014-03-31 Thread Tom Lane
Robert Haas writes: > Adding attributes to bootstrap tables is a whole lot more fiddly than > for other system tables. I suggest looking at a patch that did this > to see what's involved. For example, commit > 76a47c0e7423891d4b4f0977312f46fec6c5c416 removed and replaced a column > in pg_attribut

Re: [HACKERS] issue log message to suggest VACUUM FULL if a table is nearly empty

2014-03-31 Thread Robert Haas
On Mon, Mar 31, 2014 at 12:35 AM, Amit Kapila wrote: > On Wed, Mar 26, 2014 at 11:32 AM, Robert Haas wrote: >> On Sun, Mar 9, 2014 at 5:28 PM, Wang, Jing wrote: >>> Enclosed is the patch to implement the requirement that issue log message to >>> suggest VACUUM FULL if a table is nearly empty. >>

Re: [HACKERS] Securing "make check" (CVE-2014-0067)

2014-03-31 Thread Robert Haas
On Sun, Mar 30, 2014 at 3:52 PM, Christoph Berg wrote: > Re: Noah Misch 2014-03-30 <20140330014531.ge170...@tornado.leadboat.com> >> On Sat, Mar 29, 2014 at 10:04:55AM +0100, Christoph Berg wrote: >> > Fwiw, to relocate the pg_regress socket dir, there is already the >> > possibility to run make c

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread David Johnston
steve k wrote > I started with this: > DBInsert_excerpts6_test_cpdlc.cpp > > > Can you point out to me where in that code you've followed this instruction from the documentation: "After successfully ca

Re: [HACKERS] PATCH: decreasing memory needlessly consumed by array_agg

2014-03-31 Thread Robert Haas
On Thu, Mar 27, 2014 at 10:00 PM, Tomas Vondra wrote: > The patch also does one more thing - it changes how the arrays (in the > aggregate state) grow. Originally it worked like this > > /* initial size */ > astate->alen = 64; > > /* when full, grow exponentially */ > if (astate->n

Re: [HACKERS] Still something fishy in the fastpath lock stuff

2014-03-31 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 26, 2014 at 12:59 AM, Robert Haas wrote: >> It seems to me that the simplest thing to do might be >> just this: >> >> -static FastPathStrongRelationLockData *FastPathStrongRelationLocks; >> +static volatile FastPathStrongRelationLockData *FastPathStrongRelationL

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

2014-03-31 Thread Peter Geoghegan
On Mon, Mar 31, 2014 at 8:08 AM, Heikki Linnakangas wrote: > Note the last sentence. To avoid the undefined behavior, you have to pass a > buffer that's large enough to hold the whole result, and then truncate the > result. I was working off the glibc documentation, which says: "The return value

Re: [HACKERS] Securing "make check" (CVE-2014-0067)

2014-03-31 Thread Tom Lane
Robert Haas writes: > On Sun, Mar 30, 2014 at 3:52 PM, Christoph Berg wrote: >> Oh, right. There's this other patch which apparently works so well >> that I already forgot it's there: >> >> Enable pg_regress --host=/path/to/socket: >> https://alioth.debian.org/scm/loggerhead/pkg-postgresql/postg

Re: [HACKERS] Cube extension kNN support

2014-03-31 Thread Sergey Konoplev
On Mon, Mar 31, 2014 at 12:09 PM, Alexander Korotkov wrote: >> I'm not sure if it is doable at all, but are there any possibility to >> implement here, or, what would be just great, any ready/half ready >> solutions of a Hamming distance based kNN search? > > Cube dealing with float8 numbers. Ther

Re: [HACKERS] Cube extension kNN support

2014-03-31 Thread Alexander Korotkov
On Mon, Mar 31, 2014 at 10:01 PM, Sergey Konoplev wrote: > On Thu, Mar 27, 2014 at 3:26 PM, Sergey Konoplev > wrote: > > On Sun, Sep 22, 2013 at 4:38 PM, Stas Kelvich > wrote: > >> Here is the patch that introduces kNN search for cubes with euclidean, > taxicab and chebyshev distances. > > > >

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Stephen Frost
* Fabrízio de Royes Mello (fabriziome...@gmail.com) wrote: > - CREATE SEQUENCE [ IF NOT EXISTS ] > - CREATE DOMAIN [ IF NOT EXISTS ] > - CREATE EVENT TRIGGER [ IF NOT EXISTS ] > - CREATE ROLE [ IF NOT EXISTS ] > > Seems that no one reviewed this part or was rejected with others? Why don't those f

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Fabrízio de Royes Mello
On Mon, Mar 31, 2014 at 4:52 PM, Stephen Frost wrote: > > * Fabrízio de Royes Mello (fabriziome...@gmail.com) wrote: > > - CREATE SEQUENCE [ IF NOT EXISTS ] > > - CREATE DOMAIN [ IF NOT EXISTS ] > > - CREATE EVENT TRIGGER [ IF NOT EXISTS ] > > - CREATE ROLE [ IF NOT EXISTS ] > > > > Seems that no

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Stephen Frost
* Fabrízio de Royes Mello (fabriziome...@gmail.com) wrote: > On Mon, Mar 31, 2014 at 4:52 PM, Stephen Frost wrote: > > > > * Fabrízio de Royes Mello (fabriziome...@gmail.com) wrote: > > > - CREATE SEQUENCE [ IF NOT EXISTS ] > > > - CREATE DOMAIN [ IF NOT EXISTS ] > > > - CREATE EVENT TRIGGER [ IF

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread steve k
David, The code I posted is what I started/finished with. As I tried to figure things out I kept adding PQgetResult, PQresultStatus and PQresultErrorMessage calls and writing the results to the log file. By the time I was done it was so messy that I stripped all that messaging/logging back out

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Fabrízio de Royes Mello
On Mon, Mar 31, 2014 at 5:00 PM, Stephen Frost wrote: > > * Fabrízio de Royes Mello (fabriziome...@gmail.com) wrote: > > On Mon, Mar 31, 2014 at 4:52 PM, Stephen Frost wrote: > > > > > > * Fabrízio de Royes Mello (fabriziome...@gmail.com) wrote: > > > > - CREATE SEQUENCE [ IF NOT EXISTS ] > > > >

Re: [HACKERS] Securing "make check" (CVE-2014-0067)

2014-03-31 Thread Christoph Berg
Re: Tom Lane 2014-03-31 <22183.1396293...@sss.pgh.pa.us> > >> Enable pg_regress --host=/path/to/socket: > >> https://alioth.debian.org/scm/loggerhead/pkg-postgresql/postgresql-9.4/trunk/view/head:/debian/patches/60-pg_regress_socketdir.patch > > > Wasn't this patch submitted for inclusion in Postg

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

2014-03-31 Thread Tom Lane
Peter Geoghegan writes: > On Mon, Mar 31, 2014 at 8:08 AM, Heikki Linnakangas > wrote: >> Note the last sentence. To avoid the undefined behavior, you have to pass a >> buffer that's large enough to hold the whole result, and then truncate the >> result. > I was working off the glibc documentati

Re: [HACKERS] Securing "make check" (CVE-2014-0067)

2014-03-31 Thread Robert Haas
On Mon, Mar 31, 2014 at 3:19 PM, Tom Lane wrote: > Robert Haas writes: >> On Sun, Mar 30, 2014 at 3:52 PM, Christoph Berg wrote: >>> Oh, right. There's this other patch which apparently works so well >>> that I already forgot it's there: >>> >>> Enable pg_regress --host=/path/to/socket: >>> http

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Stephen Frost
* Fabrízio de Royes Mello (fabriziome...@gmail.com) wrote: > Because they maintain user data? Eh? You mean like the sequence #? Yes, I'd expect 'CREATE OR REPLACE SEQUENCE' to want a minvalue or something on a 'replace' case to ensure that it doesn't roll backwards unless explicitly asked for.

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread David Johnston
steve k wrote > Sorry I can't provide more information but I do appreciate your time. If > you can't get any further with it I understand and don't expect another > reply. For the benefit of others I'm reading this as basically you've found a better way to do this so you are no longer concerned

Re: [HACKERS] Archive recovery won't be completed on some situation.

2014-03-31 Thread Robert Haas
On Fri, Mar 28, 2014 at 1:06 AM, Kyotaro HORIGUCHI wrote: > Mmm. I don't think it is relevant to this problem. The problem > specific here is 'The database was running until just now, but > shutdown the master (by pacemaker), then restart, won't run > anymore'. Deleting backup_label after immediat

Re: [HACKERS] posting tree compression (WAS: Proposal: fix range queries in btree_gin)

2014-03-31 Thread Robert Haas
On Fri, Mar 28, 2014 at 11:30 AM, Alexander Korotkov wrote: > after reading Heikki Linnakangas presentation about GIN from Nordic PGDay, I > figure out that btree_gin became much more attractive. > http://hlinnaka.iki.fi/presentations/NordicPGDay2014-GIN.pdf This is a mighty interesting presentat

Re: [HACKERS] posting tree compression (WAS: Proposal: fix range queries in btree_gin)

2014-03-31 Thread Claudio Freire
On Mon, Mar 31, 2014 at 6:21 PM, Robert Haas wrote: > On Fri, Mar 28, 2014 at 11:30 AM, Alexander Korotkov > wrote: >> after reading Heikki Linnakangas presentation about GIN from Nordic PGDay, I >> figure out that btree_gin became much more attractive. >> http://hlinnaka.iki.fi/presentations/Nor

Re: [HACKERS] posting tree compression (WAS: Proposal: fix range queries in btree_gin)

2014-03-31 Thread Tom Lane
Claudio Freire writes: > On Mon, Mar 31, 2014 at 6:21 PM, Robert Haas wrote: >> On Fri, Mar 28, 2014 at 11:30 AM, Alexander Korotkov >> wrote: >>> after reading Heikki Linnakangas presentation about GIN from Nordic PGDay, I >>> figure out that btree_gin became much more attractive. >>> http://hl

Re: [HACKERS] posting tree compression (WAS: Proposal: fix range queries in btree_gin)

2014-03-31 Thread Claudio Freire
On Mon, Mar 31, 2014 at 6:37 PM, Tom Lane wrote: > Claudio Freire writes: >> On Mon, Mar 31, 2014 at 6:21 PM, Robert Haas wrote: >>> On Fri, Mar 28, 2014 at 11:30 AM, Alexander Korotkov >>> wrote: after reading Heikki Linnakangas presentation about GIN from Nordic PGDay, I figur

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Fabrízio de Royes Mello
On Mon, Mar 31, 2014 at 5:46 PM, Stephen Frost wrote: > > * Fabrízio de Royes Mello (fabriziome...@gmail.com) wrote: > > Because they maintain user data? > > Eh? You mean like the sequence #? Yes, I'd expect 'CREATE OR REPLACE > SEQUENCE' to want a minvalue or something on a 'replace' case to en

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

2014-03-31 Thread Peter Geoghegan
On Mon, Mar 31, 2014 at 1:30 PM, Tom Lane wrote: > Possibly worth noting is that on my RHEL6 and Fedora machines, > "man strxfrm" says the same thing as the POSIX spec. Likewise on OS X. > I don't think we can rely on what you suggest. Okay. Attached revision only trusts strxfrm() blobs (as far

Re: [HACKERS] [BUG FIX] Compare returned value by socket() against PGINVALID_SOCKET instead of < 0

2014-03-31 Thread Bruce Momjian
On Wed, Dec 25, 2013 at 01:35:15PM +0100, Joel Jacobson wrote: > Hi, > > I've tried to fix some bugs reported by Andrey Karpov in an article at > http://www.viva64.com/en/b/0227/ > > The value returned by socket() is unsigned on Windows and can thus not > be checked if less than zero to detect an

Re: [HACKERS] Fix memset usage in pgcrypto

2014-03-31 Thread Bruce Momjian
On Thu, Dec 26, 2013 at 03:42:12PM +0200, Marko Kreen wrote: > http://www.viva64.com/en/b/0227/ reported that on-stack memset()s > might be optimized away by compilers. Fix it. > > * Replace memset() with px_memset() > * Add px_memset to copy_crlf() > * ADd px_memset to pgp-s2k.c Where are we on

Re: [HACKERS] Comment in src/backend/commands/vacuumlazy.c

2014-03-31 Thread Amit Langote
On Mon, Mar 31, 2014 at 11:44 PM, Robert Haas wrote: > On Mon, Mar 24, 2014 at 12:28 AM, Amit Langote > wrote: >> Hi, >> >> Note the following comment in >> src/backend/commands/vacuumlazy.c:lazy_scan_heap() >> >> 1088 /* If no indexes, make log report that lazy_vacuum_heap >> would've made

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Michael Paquier
On Tue, Apr 1, 2014 at 7:28 AM, Fabrízio de Royes Mello wrote: > Think about the statements below: > > CREATE ROLE test NOLOGIN; > CREATE OR REPLACE ROLE test; > > If we execute the statements above the result should be the role 'test' can > login. Correct? Except if I am missing something, the se

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Stephen Frost
* Michael Paquier (michael.paqu...@gmail.com) wrote: > On Tue, Apr 1, 2014 at 7:28 AM, Fabrízio de Royes Mello > wrote: > > Think about the statements below: > > > > CREATE ROLE test NOLOGIN; > > CREATE OR REPLACE ROLE test; > > > > If we execute the statements above the result should be the role

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Fabrízio de Royes Mello
On Tue, Apr 1, 2014 at 1:14 AM, Michael Paquier wrote: > > On Tue, Apr 1, 2014 at 7:28 AM, Fabrízio de Royes Mello > wrote: > > Think about the statements below: > > > > CREATE ROLE test NOLOGIN; > > CREATE OR REPLACE ROLE test; > > > > If we execute the statements above the result should be the

Re: [HACKERS] PQputCopyData dont signal error

2014-03-31 Thread Michael Paquier
On Tue, Apr 1, 2014 at 1:33 AM, Alvaro Herrera wrote: > steve k wrote: > >> I am examining other ways to do mass inserts/writes that allow for >> notification if some of the data contained within for some reason fails to >> copy/insert so that the cause of the bad data can be examined and remedied

Re: [HACKERS] Archive recovery won't be completed on some situation.

2014-03-31 Thread Jeff Janes
On Monday, March 31, 2014, Robert Haas wrote: > On Fri, Mar 28, 2014 at 1:06 AM, Kyotaro HORIGUCHI > > wrote: > > Mmm. I don't think it is relevant to this problem. The problem > > specific here is 'The database was running until just now, but > > shutdown the master (by pacemaker), then restart,

Re: [HACKERS] issue log message to suggest VACUUM FULL if a table is nearly empty

2014-03-31 Thread Amit Kapila
On Tue, Apr 1, 2014 at 12:24 AM, Robert Haas wrote: > On Mon, Mar 31, 2014 at 12:35 AM, Amit Kapila wrote: >> On Wed, Mar 26, 2014 at 11:32 AM, Robert Haas wrote: >>> I'm not really too sure >>> whether it makes sense to try to make an automated recommendation >>> here, or maybe only in egregio

Re: [HACKERS] Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

2014-03-31 Thread Michael Paquier
On Tue, Apr 1, 2014 at 1:34 PM, Stephen Frost wrote: > * Michael Paquier (michael.paqu...@gmail.com) wrote: >> On Tue, Apr 1, 2014 at 7:28 AM, Fabrízio de Royes Mello >> wrote: >> > Think about the statements below: >> > >> > CREATE ROLE test NOLOGIN; >> > CREATE OR REPLACE ROLE test; >> > >> > I

[HACKERS] Typo fix in contrib/sepgsql/relation.c

2014-03-31 Thread Amit Langote
Hi, Just noticed the following in contrib/sepgsql/relation.c: 1 /* - 2 * 3 * contrib/sepgsql/label.c 4 * Attached fixes this. -- Amit sepgsql-file-label-fix.patch Description: Binary data -- Sent via pgsql-hackers ma

Re: [HACKERS] Typo fix in contrib/sepgsql/relation.c

2014-03-31 Thread Heikki Linnakangas
On 04/01/2014 08:58 AM, Amit Langote wrote: Hi, Just noticed the following in contrib/sepgsql/relation.c: 1 /* - 2 * 3 * contrib/sepgsql/label.c 4 * Attached fixes this. Thanks, fixed. - Heikki -- Sent via pgsql-ha