Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Robert Haas
On Fri, Dec 20, 2013 at 7:51 AM, Andres Freund wrote: >> I wondered that, too, but it's not well-defined for all tuples. What >> happens if you pass in constructed tuple rather than an on-disk tuple? > > Those should be discernible I think, t_self/t_tableOid won't be set for > generated tuples.

Re: [HACKERS] XML Issue with DTDs

2013-12-20 Thread Florian Pflug
On Dec20, 2013, at 18:52 , Robert Haas wrote: > On Thu, Dec 19, 2013 at 6:40 PM, Florian Pflug wrote: >> Solving this seems a bit messy, unfortunately. First, I think we need to >> have some XMLOPTION value which is a superset of all the others - otherwise, >> dump & restore won't work reliably

Re: [HACKERS] make_interval ??

2013-12-20 Thread Josh Berkus
On 12/20/2013 04:44 PM, Gavin Flower wrote: > On 21/12/13 13:40, Josh Berkus wrote: >> On 12/20/2013 03:09 PM, Gavin Flower wrote: >>> What about leap years? >> What about them? >> > some years have 365 days others have 366, so how any days in an interval > of 2 years?, 4 years? Your question isn'

Re: [HACKERS] make_interval ??

2013-12-20 Thread Gavin Flower
On 21/12/13 13:40, Josh Berkus wrote: On 12/20/2013 03:09 PM, Gavin Flower wrote: What about leap years? What about them? some years have 365 days others have 366, so how any days in an interval of 2 years?, 4 years? -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] make_interval ??

2013-12-20 Thread Josh Berkus
On 12/20/2013 03:09 PM, Gavin Flower wrote: > What about leap years? What about them? -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsq

Re: [HACKERS] nested hstore patch

2013-12-20 Thread Andres Freund
On 2013-12-20 15:16:30 -0800, David E. Wheeler wrote: > But for the hstore feature itself, I think the current interface and features > are ready to go. I think this patch needs significant amount of work because it can be considered ready for committer. I found the list of issues in http://archi

Re: [HACKERS] nested hstore patch

2013-12-20 Thread David E. Wheeler
On Nov 12, 2013, at 10:35 AM, Teodor Sigaev wrote: > Hi! > > Attatched patch adds nesting feature, types (string, boll and numeric > values), arrays and scalar to hstore type. My apologies for not getting to this sooner, work has been a bit nutty. The truth is that I reviewed this patch quite

Re: [HACKERS] make_interval ??

2013-12-20 Thread Gavin Flower
On 21/12/13 06:29, Josh Berkus wrote: Pavel, So constructor should to look like: CREATE OR REPLACE FUNCTION make_interval(years int DEFAULT 0, months int DEFAULT 0, ...) and usage: SELECT make_interval(years := 2) SELECT make_interval(days := 14) Is there a interest for this (or similar) fu

Re: [HACKERS] INSERT...ON DUPLICATE KEY LOCK FOR UPDATE

2013-12-20 Thread Peter Geoghegan
On Fri, Dec 20, 2013 at 12:39 PM, Heikki Linnakangas wrote: > Hmm. If I understand the problem correctly, it's that as soon as another > backend sees the tuple you've inserted and calls XactLockTableWait(), it > will not stop waiting even if we later decide to kill the already-inserted > tuple. F

Re: [HACKERS] INSERT...ON DUPLICATE KEY LOCK FOR UPDATE

2013-12-20 Thread Heikki Linnakangas
On 12/20/2013 10:56 PM, Alvaro Herrera wrote: Robert Haas escribió: On Fri, Dec 20, 2013 at 3:39 PM, Heikki Linnakangas wrote: Hmm. If I understand the problem correctly, it's that as soon as another backend sees the tuple you've inserted and calls XactLockTableWait(), it will not stop waiting

Re: [HACKERS] shared memory message queues

2013-12-20 Thread Andres Freund
Hi, On 2013-12-18 15:23:23 -0500, Robert Haas wrote: > It sounds like most people who have looked at this stuff are broadly > happy with it, so I'd like to push on toward commit soon, but it'd be > helpful, Andres, if you could review the comment additions to > shm-mq-v2.patch and see whether thos

Re: [HACKERS] INSERT...ON DUPLICATE KEY LOCK FOR UPDATE

2013-12-20 Thread Alvaro Herrera
Robert Haas escribió: > On Fri, Dec 20, 2013 at 3:39 PM, Heikki Linnakangas > wrote: > > Hmm. If I understand the problem correctly, it's that as soon as another > > backend sees the tuple you've inserted and calls XactLockTableWait(), it > > will not stop waiting even if we later decide to kill t

Re: [HACKERS] INSERT...ON DUPLICATE KEY LOCK FOR UPDATE

2013-12-20 Thread Robert Haas
On Fri, Dec 20, 2013 at 3:39 PM, Heikki Linnakangas wrote: > Hmm. If I understand the problem correctly, it's that as soon as another > backend sees the tuple you've inserted and calls XactLockTableWait(), it > will not stop waiting even if we later decide to kill the already-inserted > tuple. > >

Re: [HACKERS] INSERT...ON DUPLICATE KEY LOCK FOR UPDATE

2013-12-20 Thread Heikki Linnakangas
On 12/20/2013 06:06 AM, Peter Geoghegan wrote: On Wed, Dec 18, 2013 at 8:39 PM, Peter Geoghegan wrote: Empirically, retrying because ExecInsertIndexTuples() returns some recheckIndexes occurs infrequently, so maybe that makes all of this okay. Or maybe it happens infrequently *because* we don't

Re: [HACKERS] GIN improvements part 1: additional information

2013-12-20 Thread Alexander Korotkov
On Fri, Dec 20, 2013 at 11:36 PM, Heikki Linnakangas < hlinnakan...@vmware.com> wrote: > On 12/19/2013 03:33 PM, Heikki Linnakangas wrote: > >> On 12/17/2013 12:49 AM, Heikki Linnakangas wrote: >> >>> On 12/17/2013 12:22 AM, Alexander Korotkov wrote: >>> On Mon, Dec 16, 2013 at 3:30 PM, Heikk

Re: [HACKERS] GIN improvements part 1: additional information

2013-12-20 Thread Alvaro Herrera
Alexander Korotkov escribió: > On Fri, Dec 20, 2013 at 11:43 PM, Alvaro Herrera > wrote: > > > Heikki Linnakangas escribió: > > > > > I believe that eliminates all encodings in the Simple family, as > > > well as PForDelta, and surprisingly also Rice encoding. For example, > > > if you have three

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Robert Haas
On Fri, Dec 20, 2013 at 2:17 PM, Alvaro Herrera wrote: > Robert Haas escribió: >> On Fri, Dec 20, 2013 at 1:41 PM, Alvaro Herrera >> wrote: > >> > I assume without checking that passing reloid/ctid would allow this to >> > work for tuples in a RETURNING clause; and if we ever have an OLD >> > ref

Re: [HACKERS] shared memory message queues

2013-12-20 Thread Robert Haas
On Fri, Dec 20, 2013 at 2:33 PM, Andres Freund wrote: > On 2013-12-20 14:10:57 -0500, Robert Haas wrote: >> > Since you're embedding spinlocks in struct shm_toc, this module will be >> > in conflict with platforms that do --disable-spinlocks, since the number >> > of spinlocks essentially needs to

Re: [HACKERS] GIN improvements part 1: additional information

2013-12-20 Thread Alexander Korotkov
On Fri, Dec 20, 2013 at 11:43 PM, Alvaro Herrera wrote: > Heikki Linnakangas escribió: > > > I believe that eliminates all encodings in the Simple family, as > > well as PForDelta, and surprisingly also Rice encoding. For example, > > if you have three items in consecutive offsets, the differences

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Alvaro Herrera
Robert Haas escribió: > On Fri, Dec 20, 2013 at 1:41 PM, Alvaro Herrera > wrote: > > I assume without checking that passing reloid/ctid would allow this to > > work for tuples in a RETURNING clause; and if we ever have an OLD > > reference for the RETURNING clause of an UPDATE, that it would work

Re: [HACKERS] GIN improvements part 1: additional information

2013-12-20 Thread Alvaro Herrera
Heikki Linnakangas escribió: > I believe that eliminates all encodings in the Simple family, as > well as PForDelta, and surprisingly also Rice encoding. For example, > if you have three items in consecutive offsets, the differences > between them are encoded as 11 in rice encoding. If you remove

Re: [HACKERS] Logging WAL when updating hintbit

2013-12-20 Thread Heikki Linnakangas
On 12/20/2013 08:34 PM, Fujii Masao wrote: On Fri, Dec 20, 2013 at 2:05 PM, Sawada Masahiko wrote: On Fri, Dec 20, 2013 at 3:38 AM, Sawada Masahiko wrote: I attached the patch which changes name from 'wal_log_hintbits' to 'wal_log_hints'. It gained the approval of plural. Sorry the patch wh

Re: [HACKERS] GIN improvements part 1: additional information

2013-12-20 Thread Heikki Linnakangas
On 12/19/2013 03:33 PM, Heikki Linnakangas wrote: On 12/17/2013 12:49 AM, Heikki Linnakangas wrote: On 12/17/2013 12:22 AM, Alexander Korotkov wrote: On Mon, Dec 16, 2013 at 3:30 PM, Heikki Linnakangas wrote: On 12/12/2013 06:44 PM, Alexander Korotkov wrote: When values are packed into s

Re: [HACKERS] shared memory message queues

2013-12-20 Thread Andres Freund
On 2013-12-20 14:10:57 -0500, Robert Haas wrote: > > Since you're embedding spinlocks in struct shm_toc, this module will be > > in conflict with platforms that do --disable-spinlocks, since the number > > of spinlocks essentially needs to be predetermined there. I personally > > still think the so

Re: [HACKERS] patch: option --if-exists for pg_dump

2013-12-20 Thread Pavel Stehule
Hello next version pg_restore knows --if-exists option now Regards Pavel Stehule 2013/12/13 Pavel Stehule > Hello > > I am sending a rebased patch. > > Now dump generated with --if-exists option is readable by pg_restore > > Regards > > Pavel > commit 7c79aa77ccf53252bac8ce2302a7a0f7a1942e9

Re: [HACKERS] Logging WAL when updating hintbit

2013-12-20 Thread Robert Haas
On Fri, Dec 20, 2013 at 9:06 AM, Alvaro Herrera wrote: > Michael Paquier escribió: >> On Fri, Dec 20, 2013 at 1:05 PM, Sawada Masahiko >> wrote: > >> > Sorry the patch which I attached has wrong indent on pg_controldata. >> > I have modified it and attached the new version patch. >> Now that you

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Robert Haas
On Fri, Dec 20, 2013 at 1:41 PM, Alvaro Herrera wrote: > Robert Haas escribió: >> On Fri, Dec 20, 2013 at 7:22 AM, Andres Freund >> wrote: >> >> Maybe what we should do is add a function something like >> >> pg_tuple_header(tableoid, ctid) that returns a record, maybe something >> >> like (rawxm

Re: [HACKERS] shared memory message queues

2013-12-20 Thread Robert Haas
On Fri, Dec 20, 2013 at 1:11 PM, Andres Freund wrote: > On 2013-10-31 12:21:31 -0400, Robert Haas wrote: >> Patch #2, shm-toc-v1.patch, provides a facility for sizing a dynamic >> shared memory segment before creation, and for dividing it up into >> chunks after it's been created. It therefore se

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Alvaro Herrera
Robert Haas escribió: > On Fri, Dec 20, 2013 at 7:22 AM, Andres Freund wrote: > >> Maybe what we should do is add a function something like > >> pg_tuple_header(tableoid, ctid) that returns a record, maybe something > >> like (rawxmin xid, rawxmax xid, rawcid cid, infomask int, infomask2 > >> int,

Re: [HACKERS] Logging WAL when updating hintbit

2013-12-20 Thread Fujii Masao
On Fri, Dec 20, 2013 at 2:05 PM, Sawada Masahiko wrote: > On Fri, Dec 20, 2013 at 3:38 AM, Sawada Masahiko > wrote: >> On Thu, Dec 19, 2013 at 12:37 PM, Amit Kapila >> wrote: >>> On Wed, Dec 18, 2013 at 11:30 AM, Michael Paquier >>> wrote: On Wed, Dec 18, 2013 at 11:22 AM, Amit Kapila

Re: [HACKERS] shared memory message queues

2013-12-20 Thread Andres Freund
On 2013-10-31 12:21:31 -0400, Robert Haas wrote: > Patch #2, shm-toc-v1.patch, provides a facility for sizing a dynamic > shared memory segment before creation, and for dividing it up into > chunks after it's been created. It therefore serves a function quite > similar to RequestAddinShmemSpace, e

Re: [HACKERS] XML Issue with DTDs

2013-12-20 Thread Robert Haas
On Thu, Dec 19, 2013 at 6:40 PM, Florian Pflug wrote: > While looking into ways to implement a XMLSTRIP function which extracts the > textual contents of an XML value and de-escapes them (i.e. > Solving this > seems a bit messy, unfortunately. First, I think we need to have some > XMLOPTION val

Re: [HACKERS] make_interval ??

2013-12-20 Thread Josh Berkus
Pavel, > So constructor should to look like: > > CREATE OR REPLACE FUNCTION make_interval(years int DEFAULT 0, months int > DEFAULT 0, ...) > > and usage: > > SELECT make_interval(years := 2) > SELECT make_interval(days := 14) > > Is there a interest for this (or similar) function? It would c

[HACKERS] [PATCH] Make various variables read-only (const)

2013-12-20 Thread Oskari Saarenmaa
This allows the variables to be moved from .data to .rodata section which means that more data can be shared by processes and makes sure that nothing can accidentally overwrite the read-only definitions. On a x86-64 Linux system this moves roughly 9 kilobytes of previously writable data to the rea

Re: [HACKERS] GIN improvements part 1: additional information

2013-12-20 Thread Heikki Linnakangas
On 12/19/2013 10:44 AM, Heikki Linnakangas wrote: On 12/19/2013 08:37 AM, Oleg Bartunov wrote: Guys, before digging deep into the art of comp/decomp world I'd like to know if you familiar with results of http://wwwconference.org/www2008/papers/pdf/p387-zhangA.pdf paper and some newer research ?

Re: [HACKERS] ERROR during end-of-xact/FATAL

2013-12-20 Thread Alvaro Herrera
Robert Haas escribió: > On Thu, Nov 28, 2013 at 10:10 AM, Alvaro Herrera > wrote: > > Robert Haas escribió: > >> On Wed, Nov 6, 2013 at 9:40 AM, Alvaro Herrera > >> wrote: > >> > Noah Misch wrote: > >> >> Incomplete list: > >> >> > >> >> - If smgrDoPendingDeletes() finds files to delete, mdunlin

[HACKERS] Fw: LSF/MM 2014 Call For Proposals

2013-12-20 Thread Jonathan Corbet
During the direct I/O discussion I'd suggested that somebody from the PostgreSQL community might want to put in an appearance at the LSFMM summit in March. Here's the CFP. My guess is that a proposal for a session on avoiding performance regressions for systems like PostgreSQL, probably crossing

[HACKERS] [bug fix] psql \copy doesn't end if backend is killed

2013-12-20 Thread MauMau
Hello, I've encountered a bug on PG 9.2 and fixed it for 9.4. Please find attached the patch. I'd like it to be backported to at least 9.2. [Problem] If the backend is terminated with SIGKILL while psql is running "\copy table_name from file_name", the \copy didn't end forever. I expected

Re: [HACKERS] Logging WAL when updating hintbit

2013-12-20 Thread Alvaro Herrera
Michael Paquier escribió: > On Fri, Dec 20, 2013 at 1:05 PM, Sawada Masahiko > wrote: > > Sorry the patch which I attached has wrong indent on pg_controldata. > > I have modified it and attached the new version patch. > Now that you send this patch, I am just recalling some recent email > from T

Re: [HACKERS] Re: [bug fix] multibyte messages are displayed incorrectly on the client

2013-12-20 Thread Alvaro Herrera
Noah Misch escribió: > On Tue, Dec 17, 2013 at 01:42:08PM -0500, Bruce Momjian wrote: > > On Fri, Dec 13, 2013 at 10:41:17PM +0900, MauMau wrote: > > > [Fix] > > > Disable message localization during session startup. In other > > > words, messages are output in English until the database session

Re: [HACKERS] New option for pg_basebackup, to specify a different directory for pg_xlog

2013-12-20 Thread Alvaro Herrera
Haribabu kommi escribió: > From the compilation I observed as libpgcommon is linking while building ecpg. > I tested the same by using psprintf directly in ecpg code. > > I modified the libecpg's Makefile as suggested by you which is attached in > the mail, > Still the errors are occurring. Plea

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Alvaro Herrera
Robert Haas escribió: > Maybe what we should do is add a function something like > pg_tuple_header(tableoid, ctid) that returns a record, maybe something > like (rawxmin xid, rawxmax xid, rawcid cid, infomask int, infomask2 > int, hoff int). Or perhaps some slightly more cooked version of that >

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Andres Freund
On 2013-12-20 07:58:46 -0500, Robert Haas wrote: > I think the immediate problem is to decide whether this patch ought to > make the xmin column display the result of GetXmin() or GetRawXmin(). > Thoughts on that? I slightly favor GetRawXmin(). Greetings, Andres Freund -- Andres Freund

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Robert Haas
On Fri, Dec 20, 2013 at 7:51 AM, Andres Freund wrote: > On 2013-12-20 07:47:17 -0500, Robert Haas wrote: >> On Fri, Dec 20, 2013 at 7:22 AM, Andres Freund >> wrote: >> >> Maybe what we should do is add a function something like >> >> pg_tuple_header(tableoid, ctid) that returns a record, maybe s

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Andres Freund
On 2013-12-20 07:47:17 -0500, Robert Haas wrote: > On Fri, Dec 20, 2013 at 7:22 AM, Andres Freund wrote: > >> Maybe what we should do is add a function something like > >> pg_tuple_header(tableoid, ctid) that returns a record, maybe something > >> like (rawxmin xid, rawxmax xid, rawcid cid, infoma

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Robert Haas
On Fri, Dec 20, 2013 at 7:22 AM, Andres Freund wrote: >> Maybe what we should do is add a function something like >> pg_tuple_header(tableoid, ctid) that returns a record, maybe something >> like (rawxmin xid, rawxmax xid, rawcid cid, infomask int, infomask2 >> int, hoff int). Or perhaps some sli

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Andres Freund
On 2013-12-20 07:12:01 -0500, Robert Haas wrote: > I think the root of the problem is that nobody's very eager to add > more hidden system catalog columns because each one bloats > pg_attribute significantly. I think that part is actually solveable - there's no real need for them to be real column

Re: [HACKERS] [9.3 bug] disk space in pg_xlog increases during archive recovery

2013-12-20 Thread MauMau
From: "Fujii Masao" ! if (source == XLOG_FROM_ARCHIVE && StandbyModeRequested) Even when standby_mode is not enabled, we can use cascade replication and it needs the accumulated WAL files. So I think that AllowCascadeReplication() should be added into this condition. ! snprintf(rec

Re: [HACKERS] preserving forensic information when we freeze

2013-12-20 Thread Robert Haas
On Thu, Dec 19, 2013 at 9:22 PM, Alvaro Herrera wrote: > Jim Nasby escribió: >> One thing users will lose in this patch is the ability to reliably see if a >> tuple is frozen via SQL. Today you can do that just by selecting xmin from >> the table. >> >> Obviously people don't generally need to d

Re: [HACKERS] [bug fix] pg_ctl always uses the same event source

2013-12-20 Thread MauMau
From: "Amit Kapila" Few other points: - 1. #ifdef WIN32 /* Get event source from postgresql.conf for eventlog output */ get_config_value("event_source", event_source, sizeof(event_source)); #endif event logging is done for both win32 and cygwin env. under hash define (Wi

Re: [HACKERS] New option for pg_basebackup, to specify a different directory for pg_xlog

2013-12-20 Thread Haribabu kommi
On 20 December 2013 02:02 Bruce Momjian wrote: > On Thu, Dec 19, 2013 at 05:14:50AM +, Haribabu kommi wrote: > > On 19 December 2013 05:31 Bruce Momjian wrote: > > > On Wed, Dec 11, 2013 at 10:22:32AM +, Haribabu kommi wrote: > > > > The make_absolute_path() function moving to port is chang

[HACKERS] make_interval ??

2013-12-20 Thread Pavel Stehule
Hello we have defined interface date, time, timestamp constructors. There is a question if we would to have some similar for interval type? As different from time, timestamp there we can use a zero as defaults. So constructor should to look like: CREATE OR REPLACE FUNCTION make_interval(years