Re: [HACKERS] [PATCH] backend: compare word-at-a-time in bcTruelen

2009-06-15 Thread Heikki Linnakangas
Robert Haas wrote: The advice in Stephen's email is also very good - in particular, whatever you come up with, you should submit performance results. Note that while --enable-profiling is very useful and profiling numbers are good to submit, you'll also want to make sure you do a build that is op

Re: [HACKERS] How to embed postgresql?

2009-06-15 Thread dror
In addition to my last comment, if you are looking fior real embedded database then Postgress does not fit your needs unless you would like to work with it as Server mode. With H2 (or Derby) you can work in Server mode or in embbedded mode and both are much suitable for Java applications. Regar

Re: [HACKERS] How to embed postgresql?

2009-06-15 Thread dror
If you are working with Java, it is better for you to check "H2 database", we also have Java application and until recently we worked with Postgres, few month ago we replaced it with H2. Regards Dror Date: Tue, 16 Jun 2009 12:13:38 +0800 Subject: [HACKERS] How to embed postgresql? From: s

Re: [HACKERS] How to embed postgresql?

2009-06-15 Thread Josh Berkus
On 6/15/09 9:13 PM, Bruce YUAN wrote: Dears, How to embed postgresql if possible? In our Java application solution, we need an embedded database. Berkeley DB can not meet our reqirements in performance and license, so we wish to port postgresql as embedded database. Architecture: Java -> JNI -> t

Re: [HACKERS] change do_tup_output to take Datum arguments rather than cstring

2009-06-15 Thread Robert Haas
On Mon, Jun 15, 2009 at 1:20 PM, Tom Lane wrote: > Robert Haas writes: >> it looks like I can probably rip that member out of TupOutputState >> altogether. > >> Will update patch.  Does this look like what you were thinking otherwise? > > Yeah, that's exactly what I was thinking. Excellent. Revi

Re: [HACKERS] question about meaning of character varying without length

2009-06-15 Thread Konstantin Izmailov
Here you go: fromMail Delivery Subsystem topgf...@gmail.com dateMon, Jun 15, 2009 at 9:16 PMsubjectDelivery Status Notification (Failure) hide details 9:16 PM (31 minutes ago) Reply [image: Follow up message] This is an automatically generated Delivery Status Notification Delivery to the followin

Re: [HACKERS] Patch for automating partitions in PostgreSQL 8.4 Beta 2

2009-06-15 Thread Kedar Potdar
Hi Nikhil, I am sorry for the late reply. :( Please find inline my comments. On Tue, Jun 9, 2009 at 2:54 PM, Nikhil Sontakke < nikhil.sonta...@enterprisedb.com> wrote: > Hi, > > >> >> The patch automates table partitioning to support Range and Hash >> partitions. Please refer to attached readme

Re: [HACKERS] question about meaning of character varying without length

2009-06-15 Thread Robert Haas
On Tue, Jun 16, 2009 at 12:45 AM, Konstantin Izmailov wrote: > I have tried to send to pgsql-general twice, each time it returns error: > "Relay access denied (state 14)." Will try to post to pgsql-odbc. Could you provide the full bounce message? ...Robert -- Sent via pgsql-hackers mailing list

Re: [HACKERS] question about meaning of character varying without length

2009-06-15 Thread Konstantin Izmailov
I have tried to send to pgsql-general twice, each time it returns error: "Relay access denied (state 14)." Will try to post to pgsql-odbc. Thank you! On Mon, Jun 15, 2009 at 9:29 PM, Robert Haas wrote: > On Tue, Jun 16, 2009 at 12:24 AM, Konstantin Izmailov > wrote: > > Hello, > > I've found fo

Re: [HACKERS] How to embed postgresql?

2009-06-15 Thread Robert Haas
On Tue, Jun 16, 2009 at 12:13 AM, Bruce YUAN wrote: > How to embed postgresql if possible? See http://wiki.postgresql.org/wiki/Todo#Features_We_Do_Not_Want ...Robert -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql

Re: [HACKERS] question about meaning of character varying without length

2009-06-15 Thread Robert Haas
On Tue, Jun 16, 2009 at 12:24 AM, Konstantin Izmailov wrote: > Hello, > I've found following description: "If character varying is used without > length specifier, the type accepts strings of any size. The latter is a > PostgreSQL extension." > > Does this mean that "character varying without lengt

Re: [HACKERS] [PATCH] backend: compare word-at-a-time in bcTruelen

2009-06-15 Thread Robert Haas
On Mon, Jun 15, 2009 at 9:51 PM, Jeremy Kerr wrote: > I was considering something like: > >        unsigned int spaces; >        const unsigned int wordsize = sizeof(unsigned int); > >        memset(&spaces, ' ', wordsize); > > In most cases, the compiler should be able to optimise the memset out,

[HACKERS] question about meaning of character varying without length

2009-06-15 Thread Konstantin Izmailov
Hello, I've found following description: "If character varying is used without length specifier, the type accepts strings of any size. The latter is a PostgreSQL extension." Does this mean that "character varying without length" is equivalent to "text" type. Are there any differences? I noticed t

[HACKERS] How to embed postgresql?

2009-06-15 Thread Bruce YUAN
Dears, How to embed postgresql if possible? In our Java application solution, we need an embedded database. Berkeley DB can not meet our reqirements in performance and license, so we wish to port postgresql as embedded database. Architecture: Java -> JNI -> the API is wrapped from Plan/Executor

Re: [HACKERS] Should mdxxx functions(e.g. mdread, mdwrite, mdsync etc) PANIC instead of ERROR when I/O failed?

2009-06-15 Thread Jacky Leng
>> I think the reasoning is that if those functions reported a PANIC the >> chance you could recover your data is zero, because you need the >> database system to read the other (good) data. I do not see why PANIC reduced the chance to recover my data. AFAICS, my data has already corrupted(becaus

Re: [HACKERS] [PATCH] backend: compare word-at-a-time in bcTruelen

2009-06-15 Thread Stephen Frost
Jeremy, * Jeremy Kerr (j...@ozlabs.org) wrote: > Signed-off-by: Jeremy Kerr > > --- > src/backend/utils/adt/varchar.c | 24 +--- > 1 file changed, 21 insertions(+), 3 deletions(-) Thanks for the contribution. A couple of comments: The documentation for submitting a patc

Re: [HACKERS] [PATCH] backend: compare word-at-a-time in bcTruelen

2009-06-15 Thread Jeremy Kerr
Robert, > This looks very non-portable to me. Unsurprisingly, I'm new to postgres hacking and the large number of supported platforms :) I was considering something like: unsigned int spaces; const unsigned int wordsize = sizeof(unsigned int); memset(&spaces, ' ', word

Re: [HACKERS] [PATCH] backend: compare word-at-a-time in bcTruelen

2009-06-15 Thread Robert Haas
On Jun 15, 2009, at 9:04 PM, Jeremy Kerr wrote: Signed-off-by: Jeremy Kerr --- src/backend/utils/adt/varchar.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/ varchar.c index 5f3c658..688

[HACKERS] [PATCH] backend: compare word-at-a-time in bcTruelen

2009-06-15 Thread Jeremy Kerr
Signed-off-by: Jeremy Kerr --- src/backend/utils/adt/varchar.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 5f3c658..6889dff 100644 --- a/src/backend/utils/adt/varchar.c +++

Re: [HACKERS] char() overhead on read-only workloads not so insignifcant as the docs claim it is...

2009-06-15 Thread Jeremy Kerr
Alvaro, > Maybe bcTruelen could be optimized to step on one word at a time > (perhaps by using XOR against a precomputed word filled with ' '), > instead of one byte at a time ... I have a patch for this, will send soon. Regards, Jeremy -- Sent via pgsql-hackers mailing list (pgsql-hackers@p

Re: [HACKERS] char() overhead on read-only workloads not so insignifcant as the docs claim it is...

2009-06-15 Thread Alvaro Herrera
> On Sat, Jun 13, 2009 at 3:44 PM, Stefan Kaltenbrunner > wrote: > > The specific query is causing bcTruelen to show up in the profile is: > > > > "SELECT c from sbtest where id between $1 and $2 order by c" where the > > parameters are for example > > $1 = '5009559', $2 = '5009658' - ie ranges o

Re: [HACKERS] What does log_destination = csvlog mean?

2009-06-15 Thread Bruce Momjian
Andrew Dunstan wrote: > > > Bruce Momjian wrote: > > In reading through our documentation, I am unclear how "log_destination > > = csvlog" works. It seems to me that 'cvslog' is a format-output type, > > not a real destination, or rather it is a special output format for > > stderr. Is this acc

Re: [HACKERS] What does log_destination = csvlog mean?

2009-06-15 Thread Andrew Dunstan
Bruce Momjian wrote: In reading through our documentation, I am unclear how "log_destination = csvlog" works. It seems to me that 'cvslog' is a format-output type, not a real destination, or rather it is a special output format for stderr. Is this accurate? I would like to clarify our docume

[HACKERS] What does log_destination = csvlog mean?

2009-06-15 Thread Bruce Momjian
In reading through our documentation, I am unclear how "log_destination = csvlog" works. It seems to me that 'cvslog' is a format-output type, not a real destination, or rather it is a special output format for stderr. Is this accurate? I would like to clarify our documentation. -- Bruce Mom

Re: [HACKERS] postmaster recovery and automatic restart suppression

2009-06-15 Thread Alvaro Herrera
Kolb, Harald (NSN - DE/Munich) escribió: > The recovery and restart feature is an excellent solution if the db is > running in a standalone environment and I understand that this should > not be weakened. But in a configuration where the db is only one > resource among others and where you have a

Re: [HACKERS] postmaster recovery and automatic restart suppression

2009-06-15 Thread Kolb, Harald (NSN - DE/Munich)
Hi > -Original Message- > From: ext Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Tuesday, June 09, 2009 9:20 PM > To: Kolb, Harald (NSN - DE/Munich) > Cc: Robert Haas; Greg Stark; Simon Riggs; Fujii Masao; > pgsql-hackers@postgresql.org; Czichy, Thoralf (NSN - FI/Helsinki) > Subject: R

Re: [HACKERS] machine-readable explain output

2009-06-15 Thread Tom Lane
Robert Haas writes: > it looks like I can probably rip that member out of TupOutputState > altogether. > Will update patch. Does this look like what you were thinking otherwise? Yeah, that's exactly what I was thinking. regards, tom lane -- Sent via pgsql-hackers mail

Re: [HACKERS] Modifying TOAST_TUPLE_THRESHOLD and TOAST_TUPLE_TARGET?

2009-06-15 Thread Kevin Grittner
I wrote: > Proposed patch attached. That first version was of the "minimally invasive" variety, to stress how little I was changing and minimize the chance that I would make some dumb error; however, it involved copy/paste of a few lines which were already in a source file twice. Attached is

Re: [HACKERS] machine-readable explain output

2009-06-15 Thread Robert Haas
On Mon, Jun 15, 2009 at 9:51 AM, Tom Lane wrote: > Robert Haas writes: >> Hmm... on further review, I'm thinking this is still a bit wastful, >> because we don't really need (I think) to call >> TupleDescGetAttInMetadata from begin_tup_output_tupdesc.  But I'm not >> sure what the best way is to a

Re: [HACKERS] Suppressing occasional failures in copy2 regression test

2009-06-15 Thread David Fetter
On Mon, Jun 15, 2009 at 11:34:38AM -0400, Tom Lane wrote: > David Fetter writes: > > * It's going to a lot of trouble to allow for the possibility of both > > unordered results and of duplicate lines. If we disallow duplicate > > lines in unordered result sets, we can get a big speed gain by

Re: [HACKERS] Suppressing occasional failures in copy2 regression test

2009-06-15 Thread Tom Lane
David Fetter writes: > * It's going to a lot of trouble to allow for the possibility of both > unordered results and of duplicate lines. If we disallow duplicate > lines in unordered result sets, we can get a big speed gain by using > hash-based comparisons. Why not just sort the lines and

Re: [HACKERS] Suppressing occasional failures in copy2 regression test

2009-06-15 Thread David Fetter
On Mon, Jun 15, 2009 at 07:41:29PM +0530, Gurjeet Singh wrote: > On Sun, Jun 14, 2009 at 12:39 AM, Robert Haas wrote: > > > > Greg Stark writes: > > >> I'm not sure about that. It seems like race conditions with autovacuum > > >> are a real potential bug that it would be nice to be testing for.

Re: [HACKERS] Suppressing occasional failures in copy2 regression test

2009-06-15 Thread Gurjeet Singh
On Sun, Jun 14, 2009 at 12:39 AM, Robert Haas wrote: > On Sat, Jun 13, 2009 at 2:48 PM, Tom Lane wrote: > > Greg Stark writes: > >> I'm not sure about that. It seems like race conditions with autovacuum > >> are a real potential bug that it would be nice to be testing for. > > > > It's not a bug

Re: [HACKERS] Should mdxxx functions(e.g. mdread, mdwrite, mdsync etc) PANIC instead of ERROR when I/O failed?

2009-06-15 Thread Tom Lane
Martijn van Oosterhout writes: > On Mon, Jun 15, 2009 at 04:41:42PM +0800, Jacky Leng wrote: >> My question is: should not mdxxx functions(e.g. mdread, mdwrite, mdsync) >> just report PANIC instead of ERROR when I/O failed? IMO, since the data has >> already corrupted, reporting ERROR will just

Re: [HACKERS] machine-readable explain output

2009-06-15 Thread Tom Lane
Robert Haas writes: > Hmm... on further review, I'm thinking this is still a bit wastful, > because we don't really need (I think) to call > TupleDescGetAttInMetadata from begin_tup_output_tupdesc. But I'm not > sure what the best way is to avoid that. Any thoughts? Er, just don't do it? We sh

Re: [HACKERS] char() overhead on read-only workloads not so insignifcant as the docs claim it is...

2009-06-15 Thread Gurjeet Singh
Comments? On Sat, Jun 13, 2009 at 3:44 PM, Stefan Kaltenbrunner wrote: > I'm currently doing some benchmarking on a Nehalem box( > http://www.kaltenbrunner.cc/blog/index.php?/archives/26-Benchmarking-8.4-Chapter-1Read-Only-workloads.html) > with 8.4 and while investigating what looks like issues

Re: [HACKERS] machine-readable explain output

2009-06-15 Thread Robert Haas
I wrote: > On Sun, Jun 14, 2009 at 1:04 PM, Robert Haas wrote: >> On Sun, Jun 14, 2009 at 1:02 PM, Tom Lane wrote: >>> Robert Haas writes: On Sun, Jun 14, 2009 at 11:28 AM, Tom Lane wrote: > However, using BuildTupleFromCStrings is wasteful/stupid for *both* > text and xml output, so

Re: [HACKERS] Should mdxxx functions(e.g. mdread, mdwrite, mdsync etc) PANIC instead of ERROR when I/O failed?

2009-06-15 Thread Martijn van Oosterhout
On Mon, Jun 15, 2009 at 04:41:42PM +0800, Jacky Leng wrote: > My question is: should not mdxxx functions(e.g. mdread, mdwrite, mdsync) > just report PANIC instead of ERROR when I/O failed? IMO, since the data has > already corrupted, reporting ERROR will just leave us a very curious scene > la

[HACKERS] Should mdxxx functions(e.g. mdread, mdwrite, mdsync etc) PANIC instead of ERROR when I/O failed?

2009-06-15 Thread Jacky Leng
Recently, when I was running my application on 8.3.7, my data got corrupted. The scene was like this: "invalid memory alloc request size " I invested the error data, and found that one sector of a db-block became all-zero (I confirmed the reason later, it was because that my disk got b