Re: [HACKERS] BufferAccessStrategy for bulk insert

2008-10-30 Thread Simon Riggs
On Thu, 2008-10-30 at 23:05 -0400, Robert Haas wrote: > > Whatever timings you have are worth publishing. > > Here are the timings for copying the first ten million integers into a > one-column table created in the same transaction, with and without the > patch. As you can see, now that I've cor

Re: [HACKERS] array_agg and array_accum (patch)

2008-10-30 Thread Jeff Davis
On Wed, 2008-10-29 at 00:08 -0400, Robert Haas wrote: > It's worth noting that this is the third version of this idea that has > been submitted. Ian Caulfield submitted a patch to add this, and so > did I. Someone should probably look at all three of them and compare. > If we include a function

Re: [HACKERS] can we create a record of more than one field?

2008-10-30 Thread Tom Lane
"Jaime Casanova" <[EMAIL PROTECTED]> writes: > in the spanish list someone reports that the following function > doesn't even compile: > CREATE FUNCTION select_temporal(OUT valor integer) RETURNS SETOF record AS > $BODY$ > begin > return query select 1::integer; > return; > end; > $BODY$ > LANGUAG

[HACKERS] can we create a record of more than one field?

2008-10-30 Thread Jaime Casanova
Hi, in the spanish list someone reports that the following function doesn't even compile: CREATE FUNCTION select_temporal(OUT valor integer) RETURNS SETOF record AS $BODY$ begin return query select 1::integer; return; end; $BODY$ LANGUAGE 'plpgsql' VOLATILE; and this is the error message ERROR:

Re: [HACKERS] BufferAccessStrategy for bulk insert

2008-10-30 Thread Robert Haas
> Whatever timings you have are worth publishing. Here are the timings for copying the first ten million integers into a one-column table created in the same transaction, with and without the patch. As you can see, now that I've corrected my previous error of not putting CREATE TABLE and COPY in

Re: [HACKERS] BufferAccessStrategy for bulk insert

2008-10-30 Thread Robert Haas
> You should try profiling the patch. You can count the invocations of the > buffer access routines to check its all working in the right ratios. *goes and learns how to do profile PostgreSQL* OK, that was a good suggestion. It looks like part of my problem here is that I didn't put the CREATE T

Re: [HACKERS] Strange query behavior where clause produces odd behavior on '>' query

2008-10-30 Thread Dann Corbit
> -Original Message- > From: Tom Lane [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 30, 2008 6:34 PM > To: Dann Corbit > Cc: [HACKERS]; Sherry Griffin > Subject: Re: [HACKERS] Strange query behavior where clause produces odd > behavior on '>' query > > "Dann Corbit" <[EMAIL PROTECTED

Re: [HACKERS] Sun Studio compiler warnings

2008-10-30 Thread Robert Haas
Ooooh yeah. Time for some caffeine. ...Robert On Thu, Oct 30, 2008 at 9:34 PM, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Robert Haas escribió: >> > The closing semicolon is strictly speaking not allowed here. We could >> > remove it, but that would probably upset pgindent? >> > >> > I rec

Re: [HACKERS] Strange query behavior where clause produces odd behavior on '>' query

2008-10-30 Thread Tom Lane
"Dann Corbit" <[EMAIL PROTECTED]> writes: >> What encoding/locale are you using? > Whatever the default encoding/locale is. "Whatever" is the wrong answer here. I just finished verifying that the sort order you're complaining about is the expected ordering in some locales. I suggest that you

Re: [HACKERS] Sun Studio compiler warnings

2008-10-30 Thread Alvaro Herrera
Robert Haas escribió: > > The closing semicolon is strictly speaking not allowed here. We could > > remove it, but that would probably upset pgindent? > > > > I recall that we used to have a bunch of similar problems with the AIX > > compilers a long time ago. Does anyone recall the solution, and

Re: [HACKERS] Strange query behavior where clause produces odd behavior on '>' query

2008-10-30 Thread Dann Corbit
> -Original Message- > From: Tom Lane [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 30, 2008 5:31 PM > To: Dann Corbit > Cc: [HACKERS]; Sherry Griffin > Subject: Re: [HACKERS] Strange query behavior where clause produces odd > behavior on '>' query > > "Dann Corbit" <[EMAIL PROTECTED

Re: [HACKERS] Sun Studio compiler warnings

2008-10-30 Thread Robert Haas
> The closing semicolon is strictly speaking not allowed here. We could > remove it, but that would probably upset pgindent? > > I recall that we used to have a bunch of similar problems with the AIX > compilers a long time ago. Does anyone recall the solution, and do we still > care? (Note that

Re: [HACKERS] Strange query behavior where clause produces odd behavior on '>' query

2008-10-30 Thread Tom Lane
"Dann Corbit" <[EMAIL PROTECTED]> writes: > The following query: > SELECT * FROM Customers_connxstore where customerid > 'specd' > Returns the row containing Customers_connxstore.customerid == 'SPECD' What encoding/locale are you using? And while I'm asking, which PG version?

[HACKERS] Strange query behavior where clause produces odd behavior on '>' query

2008-10-30 Thread Dann Corbit
The following query: SELECT * FROM Customers_connxstore where customerid > 'specd' Returns the row containing Customers_connxstore.customerid == 'SPECD' I would expect to get that row if the query was: SELECT * FROM Customers_connxstore where customerid >= 'specd' The other operators (<, <=, >,

Re: [HACKERS] PG_PAGE_LAYOUT_VERSION 5 - time for change

2008-10-30 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > Tom Lane <[EMAIL PROTECTED]> writes: >> ... 3b sounds good until you >> reflect that a genuinely variable chunk size would preclude random >> access to sub-ranges of a toast value. > Hm, Heikki had me convinced it wouldn't but now that I try to explain

Re: [HACKERS] PG_PAGE_LAYOUT_VERSION 5 - time for change

2008-10-30 Thread Gregory Stark
Tom Lane <[EMAIL PROTECTED]> writes: >> 2) Add page type (e.g. btree) and subtype (e.g. metapage) flag into page >> header. >> I think It will be useful when we will use share buffer for clog. > > I think this is a pretty bad idea, because it'll eat space on every page > for data that is only us

Re: [HACKERS] PG_PAGE_LAYOUT_VERSION 5 - time for change

2008-10-30 Thread Tom Lane
Zdenek Kotala <[EMAIL PROTECTED]> writes: > 1) HeapTupleHeader modification > typedef struct HeapTupleFields > { > TransactionId t_xmin; /* inserting xact ID */ > TransactionId t_xmax; /* deleting or locking xact ID */ > union > { >

Re: [HACKERS] TABLE command

2008-10-30 Thread David Rowley
Peter Eisentraut Wrote: > If I read this right, SQL would allow writing > > TABLE foo; Interesting; I managed to find it in the spec: 4) The TABLE is equivalent to the ( SELECT * FROM ) So going by that would the patch also have to support something like: WITH a AS (SELECT * FROM b) TABL

Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > Here's a patch. It seems pretty straightforward, I'll apply this > tomorrow, barring objections. Note to self: bump the catalog version. Looks sane in a fast once-over. I didn't cross-check the pg_cast.h data changes, but that's what the regressio

[HACKERS] WIP: Automatic view update rules

2008-10-30 Thread Bernd Helmle
Please find attached my current patch for automatic view update rules. This is a stripped down version of my former patch discussed before 8.3 without CHECK OPTION support and less invasive changes to the rewriter itself. I'm currently cleaning up the code with all occurences of multiple ba

Re: [HACKERS] PG_PAGE_LAYOUT_VERSION 5 - time for change

2008-10-30 Thread Gregory Stark
Zdenek Kotala <[EMAIL PROTECTED]> writes: > 3) TOAST modification > a) TOAST table per attribute > b) replace chunk id with offset+variable chunk size > c) add column identification into first chunk > > Thats all. I think infomask/infomask2 shuffle flag should be done. TOAST > modification c

Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas <[EMAIL PROTECTED]> writes: Yeah, a magical OID clearly has some issues. A new field in pg_cast is the obvious alternative. How about adding a "castmethod" char field, with values: b = binary-compatible cast (CREATE CAST ... WITHOUT FUNCTION) i = I/O coercion

[HACKERS] Updated posix fadvise patch v19

2008-10-30 Thread Gregory Stark
Here is an updated posix_fadvise patch against CVS HEAD. It's my first patch generated using git, yay. I remembered to strip out configure (WHY is that STILL in CVS!?) and convert it to context diff, but if there's anything else I've missed just shout. Changes from before: 1) Based on discussion

[HACKERS] PG_PAGE_LAYOUT_VERSION 5 - time for change

2008-10-30 Thread Zdenek Kotala
It seems that we are going to bump Page Layout Version to version 5 (see CRC patch for detail). Maybe it is good time to do some other changes. There is a list of ideas (please, do not beat me :-). Some of them we discussed in Prato and Greg maybe have more. 1) HeapTupleHeader modification ty

Re: [HACKERS] contrib/pg_stat_statements

2008-10-30 Thread Martin Pihlak
ITAGAKI Takahiro wrote: >> But is the idea of extending QueryDesc generally acceptable? Is it OK >> to make a copy of the query string? > > The only thing I'm worried about is that QueryDesc lives longer than > its queryText. Can I assume it never occurs? > I just finished validating this -- it

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Martijn van Oosterhout
On Thu, Oct 30, 2008 at 03:41:17PM +, Gregory Stark wrote: > The CRC is chosen such that if you CRC the resulting packet including the CRC > you get a CRC of 0. That can be done for whatever offset the CRC appears at I > believe. IIRC, you calculate the CRC-32 of the page, then XOR it over whe

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Alvaro Herrera
Alvaro Herrera wrote: > Hmm, oh I see another problem here -- the bit is not restored when > replayed heap_update's WAL record. I'm now wondering what other bits > are set without much care about correctly restoring them during replay. I'm now wondering whether it'd be easier to just ignore pd_f

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Jonah H. Harris
On Thu, Oct 30, 2008 at 12:14 PM, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Gregory Stark escribió: > >> What I'm wondering though -- are we going to make CRCs mandatory? Or set >> aside >> the 4 bytes even if you're not using them? Because if the size of the page >> header varies depending on w

Re: [HACKERS] WIP patch: convert SQL-language functions to return tuplestores

2008-10-30 Thread Robert Haas
> With session variables we could implement srf function in plpgsql like > current C srf function. Like > > create or replace function foo() > returns record as $$ > #option with_srf_context(datatype of srf context) > begin > return row(...); > end; > $$ language plpgsql; Oh, sure - but what

[HACKERS] [PATCH] HeapTuple version extension + code cleanup

2008-10-30 Thread Zdenek Kotala
This patch requires patch: http://archives.postgresql.org/message-id/[EMAIL PROTECTED] It add t_ver information into HeapTuple structure and add DatumGetHeapTuple function which allows to reduce code on many places. Zdenek -- Zdenek Kotala Sun Microsystems Pragu

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Alvaro Herrera
Gregory Stark escribió: > What I'm wondering though -- are we going to make CRCs mandatory? Or set aside > the 4 bytes even if you're not using them? Because if the size of the page > header varies depending on whether you're using CRCs that sounds like it would > be quite a pain. Not mandatory,

Re: [HACKERS] Question about GetAttributeByNum(Name) ExecQual.c

2008-10-30 Thread Tom Lane
Zdenek Kotala <[EMAIL PROTECTED]> writes: > Does it mean that these function are every time called with heap tuple or > untoasted row type (composite data type)? What is purpose of these function. Legacy support for third-party modules. They're really pretty much deprecated but I don't foresee

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Zdenek Kotala
Tom Lane napsal(a): Zdenek Kotala <[EMAIL PROTECTED]> writes: By the way, do you need CRC as a first page member? Is it for future development like CLOG integration into buffers? Why not put it on the end as and mark it as a special? It will reduce space requirement when CRC is not enabled. .

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Tom Lane
Zdenek Kotala <[EMAIL PROTECTED]> writes: > By the way, do you need CRC as a first page member? Is it for future > development > like CLOG integration into buffers? Why not put it on the end as and mark it > as > a special? It will reduce space requirement when CRC is not enabled. ... and make

Re: [HACKERS] WIP patch: convert SQL-language functions to return tuplestores

2008-10-30 Thread Tom Lane
I wrote: > I'm currently going to have a look at just what it would take to support > both lazy and eager evaluation in functions.c (independently of what > syntax, if any, we settle on to expose the choice to the user). If it's > either really awful or really easy we should know that before argui

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Zdenek Kotala
Alvaro Herrera napsal(a): Zdenek Kotala wrote: Alvaro Herrera napsal(a): Simon Riggs wrote: But perhaps writing a single WAL record if you scan whole page and set all bits at once. Then it makes sense in some cases. So this is what I ended up doing; attached. Please, DO NOT MOVE position of

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Gregory Stark
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Ah, actually there's another alternative -- leave the checksum on its > current position (start of struct) and move other members below > pg_pagesize_version (leaning towards pd_tli and pd_flags). That'd leave > the page version in the same position.

Re: [HACKERS] Postgres-R pacth

2008-10-30 Thread Markus Wanner
Hi, Imre Geczy wrote: > What kind of form or method must be used to patch that it can work correctly? I finally got around writing some installation instructions: http://www.postgres-r.org/documentation/installation Regards Markus Wanner -- Sent via pgsql-hackers mailing list (pgsql-hackers@

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Jonah H. Harris
On Thu, Oct 30, 2008 at 11:27 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Jonah H. Harris" <[EMAIL PROTECTED]> writes: >> On Thu, Oct 30, 2008 at 11:14 AM, Tom Lane <[EMAIL PROTECTED]> wrote: >>> Well, yeah, but it has to be able to tell which version it's dealing >>> with. I quite agree with Zdene

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Zdenek Kotala
Jonah H. Harris napsal(a): On Thu, Oct 30, 2008 at 10:33 AM, Zdenek Kotala <[EMAIL PROTECTED]> wrote: Please, DO NOT MOVE position of page version in PageHeader structure! And PG_PAGE_LAYOUT_VERSION should be bump to 5. Umm, any in-place upgrade should be capable of handling changes to the pag

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Tom Lane
"Jonah H. Harris" <[EMAIL PROTECTED]> writes: > On Thu, Oct 30, 2008 at 11:14 AM, Tom Lane <[EMAIL PROTECTED]> wrote: >> Well, yeah, but it has to be able to tell which version it's dealing >> with. I quite agree with Zdenek that keeping the version indicator >> in a fixed location is appropriate.

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Alvaro Herrera
Gregory Stark wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > > Alvaro Herrera wrote: > > > >> The "other hint bits" are: > >> > >> - LP_DEAD as used by the various callers of ItemIdMarkDead. > >> - PD_PAGE_FULL > >> - BTPageOpaque->btpo_flags and btpo_cycleid > >> > >> All of them are c

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Jonah H. Harris
On Thu, Oct 30, 2008 at 11:14 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Jonah H. Harris" <[EMAIL PROTECTED]> writes: >> On Thu, Oct 30, 2008 at 10:33 AM, Zdenek Kotala <[EMAIL PROTECTED]> wrote: >>> Please, DO NOT MOVE position of page version in PageHeader structure! And >>> PG_PAGE_LAYOUT_VERSIO

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Tom Lane
"Jonah H. Harris" <[EMAIL PROTECTED]> writes: > On Thu, Oct 30, 2008 at 10:33 AM, Zdenek Kotala <[EMAIL PROTECTED]> wrote: >> Please, DO NOT MOVE position of page version in PageHeader structure! And >> PG_PAGE_LAYOUT_VERSION should be bump to 5. > Umm, any in-place upgrade should be capable of ha

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Alvaro Herrera
Zdenek Kotala wrote: > Alvaro Herrera napsal(a): >> Simon Riggs wrote: >> >>> But perhaps writing a single WAL record if you scan whole page and set >>> all bits at once. Then it makes sense in some cases. >> >> So this is what I ended up doing; attached. > > Please, DO NOT MOVE position of page ve

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Gregory Stark
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: > Jonah H. Harris wrote: >> On Thu, Oct 30, 2008 at 10:33 AM, Zdenek Kotala <[EMAIL PROTECTED]> wrote: >>> Please, DO NOT MOVE position of page version in PageHeader structure! And >>> PG_PAGE_LAYOUT_VERSION should be bump to 5. >> >> Umm, any in-place

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Joshua D. Drake
Jonah H. Harris wrote: On Thu, Oct 30, 2008 at 10:33 AM, Zdenek Kotala <[EMAIL PROTECTED]> wrote: Please, DO NOT MOVE position of page version in PageHeader structure! And PG_PAGE_LAYOUT_VERSION should be bump to 5. Umm, any in-place upgrade should be capable of handling changes to the page he

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Jonah H. Harris
On Thu, Oct 30, 2008 at 10:33 AM, Zdenek Kotala <[EMAIL PROTECTED]> wrote: > Please, DO NOT MOVE position of page version in PageHeader structure! And > PG_PAGE_LAYOUT_VERSION should be bump to 5. Umm, any in-place upgrade should be capable of handling changes to the page header. Of, did I miss s

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Zdenek Kotala
Alvaro Herrera napsal(a): Simon Riggs wrote: But perhaps writing a single WAL record if you scan whole page and set all bits at once. Then it makes sense in some cases. So this is what I ended up doing; attached. There are some gotchas in this patch: Please, DO NOT MOVE position of page v

Re: [HACKERS] Sun Studio compiler warnings

2008-10-30 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > CMPFUNC(tsquery_lt, res < 0); > CMPFUNC(tsquery_le, res <= 0); > CMPFUNC(tsquery_eq, res == 0); > CMPFUNC(tsquery_ge, res >= 0); > CMPFUNC(tsquery_gt, res > 0); > CMPFUNC(tsquery_ne, res != 0); > The closing semicolon is strictly speaking not allowed

[HACKERS] Sun Studio compiler warnings

2008-10-30 Thread Peter Eisentraut
Sun Studio is producing these compiler warnings (among others): "tsquery_op.c", line 193: warning: syntax error: empty declaration "tsquery_op.c", line 194: warning: syntax error: empty declaration "tsquery_op.c", line 195: warning: syntax error: empty declaration "tsquery_op.c", line 196:

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Gregory Stark
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Alvaro Herrera wrote: > >> The "other hint bits" are: >> >> - LP_DEAD as used by the various callers of ItemIdMarkDead. >> - PD_PAGE_FULL >> - BTPageOpaque->btpo_flags and btpo_cycleid >> >> All of them are changed with only SetBufferCommitInfoNeedsSa

Re: [HACKERS] Please make sure your patches are on the wiki page

2008-10-30 Thread Robert Haas
>> (1) moving all of the patches committed prior to 11/1 to a separate >> section or page > > Why? To reduce clutter, but I don't feel strongly about it. >> (2) sorting the pending patches by complexity or subject matter > > Sorting them by complexity would be great, if I thought I could do it.

Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas <[EMAIL PROTECTED]> writes: Yeah, a magical OID clearly has some issues. A new field in pg_cast is the obvious alternative. How about adding a "castmethod" char field, with values: b = binary-compatible cast (CREATE CAST ... WITHOUT FUNCTION) i = I/O coercion

Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > Yeah, a magical OID clearly has some issues. A new field in pg_cast is > the obvious alternative. How about adding a "castmethod" char field, > with values: > b = binary-compatible cast (CREATE CAST ... WITHOUT FUNCTION) > i = I/O coercion cast (th

Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Heikki Linnakangas
(Resurrecting an old thread.) Tom Lane wrote: Heikki Linnakangas <[EMAIL PROTECTED]> writes: Patch attached. I'm using a magic OID "1" in pg_cast.castfunc field to mark these extra I/O conversion casts. Ugh. That's really unacceptable (doesn't it make the oidjoins regression test fail?), Y

Re: [HACKERS] Optimizing COPY

2008-10-30 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > The basic idea is to replace the custom loop in CopyReadLineText with > memchr(), because memchr() is very fast. To make that possible, perform > the client-server encoding conversion on each raw block that we read in, > before splitting it into l

Re: [HACKERS] Hot Standby: Caches and Locks

2008-10-30 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: > On Thu, 2008-10-30 at 08:30 -0400, Tom Lane wrote: >> What about using the existing >> syscache logic to re-derive inval information from watching the update >> operations? > That does sound possible, but it makes some big assumptions about > transactional

Re: [HACKERS] Block-level CRC checks

2008-10-30 Thread Alvaro Herrera
Alvaro Herrera wrote: > The "other hint bits" are: > > - LP_DEAD as used by the various callers of ItemIdMarkDead. > - PD_PAGE_FULL > - BTPageOpaque->btpo_flags and btpo_cycleid > > All of them are changed with only SetBufferCommitInfoNeedsSave being > called afterwards. I think we could get aw

[HACKERS] Optimizing COPY

2008-10-30 Thread Heikki Linnakangas
Back in March, I played around with various hacks to improve COPY FROM performance: http://archives.postgresql.org/pgsql-patches/2008-03/msg00145.php I got busy with other stuff, but I now got around to try what I planned back then. I don't know if I have the time to finish this for 8.4, but

Re: [HACKERS] Hot Standby: Caches and Locks

2008-10-30 Thread Simon Riggs
On Thu, 2008-10-30 at 08:30 -0400, Tom Lane wrote: > Simon Riggs <[EMAIL PROTECTED]> writes: > >> We can't augment the commit/abort messages because > >> we must cater for non-transactional invalidations also, plus commit > >> xlrecs are already complex enough. So we log invalidations prior to > >

Re: [HACKERS] Question about GetAttributeByNum(Name) ExecQual.c

2008-10-30 Thread Zdenek Kotala
Tom Lane napsal(a): Zdenek Kotala <[EMAIL PROTECTED]> writes: GetAttributeByNum has first parameter as HeapTupleHeader, but most functions use Datum and after that they call DatumGetHeapTupleHeader. The difference is that DatumGetHeapTupleHeader performs detoast on tuple(row type). Is it in

Re: [HACKERS] Question about GetAttributeByNum(Name) ExecQual.c

2008-10-30 Thread Tom Lane
Zdenek Kotala <[EMAIL PROTECTED]> writes: > GetAttributeByNum has first parameter as HeapTupleHeader, but most functions > use Datum and after that they call DatumGetHeapTupleHeader. The difference is > that DatumGetHeapTupleHeader performs detoast on tuple(row type). > Is it intention do not d

Re: [HACKERS] Hot Standby: Caches and Locks

2008-10-30 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: >> We can't augment the commit/abort messages because >> we must cater for non-transactional invalidations also, plus commit >> xlrecs are already complex enough. So we log invalidations prior to >> commit, queue them and then trigger the send at commit (if i

Re: [HACKERS] TABLE command

2008-10-30 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > If I read this right, SQL would allow writing > TABLE foo; > as a top-level command, equivalent to SELECT * FROM foo; (see production > ). It can be used whereever a SELECT or VALUES can be used. > This is probably about as useless as some of my ot

Re: [HACKERS] pre-MED

2008-10-30 Thread Tom Lane
David Fetter <[EMAIL PROTECTED]> writes: > On Wed, Oct 29, 2008 at 10:23:36PM -0400, Tom Lane wrote: >> I would argue that it's already designed wrong if there's need for >> PL-specific implementation effort. > I'm not sure how else to do this. The current implementation returns > char *, which d

Re: [HACKERS] contrib/pg_stat_statements

2008-10-30 Thread ITAGAKI Takahiro
Martin Pihlak <[EMAIL PROTECTED]> wrote: > Attached is a patch that adds sourceText to QueryDesc. It worked fine surprisingly :) . Internal and C functions don't use executor, so we can ignore trivial function calls (ex. operators). Furthermore, it is ok if QueryDesc doesn't have queryText becau

Re: [HACKERS] Updating FSM on recovery

2008-10-30 Thread Gregory Stark
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > Hmm. I think an enum is better than a bitmask here. At the moment, we need > three different modes of operation: > 1. Read the page as usual, throw an error on corrupted page (ReadBuffer()) > 2. Read the page, zero page on corruption (this is new)

[HACKERS] Question about GetAttributeByNum(Name) ExecQual.c

2008-10-30 Thread Zdenek Kotala
GetAttributeByNum has first parameter as HeapTupleHeader, but most functions use Datum and after that they call DatumGetHeapTupleHeader. The difference is that DatumGetHeapTupleHeader performs detoast on tuple(row type). Is it intention do not detoast in these functions or it is a bug?

Re: [HACKERS] Multi CPU Queries - Feedback and/or suggestions wanted!

2008-10-30 Thread Hans-Jürgen Schönig
Bruce Momjian wrote: Greg Stark wrote: I couldn't get async I/O to work on Linux. That is it "worked" but performed the same as reading one block at a time. On solaris the situation is reversed. In what way is fadvise a kludge? I think he is saying AIO gives us more flexibility, b

Re: [HACKERS] Hot Standby: Caches and Locks

2008-10-30 Thread Simon Riggs
On Tue, 2008-10-21 at 15:06 +0100, Simon Riggs wrote: > We can't augment the commit/abort messages because > we must cater for non-transactional invalidations also, plus commit > xlrecs are already complex enough. So we log invalidations prior to > commit, queue them and then trigger the send at

Re: [HACKERS] Updating FSM on recovery

2008-10-30 Thread Simon Riggs
On Thu, 2008-10-30 at 09:57 +, Simon Riggs wrote: > On Thu, 2008-10-30 at 10:40 +0200, Heikki Linnakangas wrote: > > > So, attached is a patch using an enum. Barring objections, I'll commit > > this. > > I probably agree with the changes from reading your post, but I'd ask > that you hang fi

Re: [HACKERS] Updating FSM on recovery

2008-10-30 Thread Simon Riggs
On Thu, 2008-10-30 at 10:40 +0200, Heikki Linnakangas wrote: > So, attached is a patch using an enum. Barring objections, I'll commit > this. I probably agree with the changes from reading your post, but I'd ask that you hang fire on committing this for a few days. It's just going to prevent Ko

Re: [HACKERS] Updating FSM on recovery

2008-10-30 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas <[EMAIL PROTECTED]> writes: The ReadBuffer() interface is already pretty complex, with all the different variants. We should probably keep the good old ReadBuffer() the same, for the sake of simplicity in the callers, but try to reduce the number of other var

Re: [HACKERS] SQL/MED compatible connection manager

2008-10-30 Thread Martin Pihlak
> I have put together a draft that describes a possible implementation: > http://wiki.postgresql.org/wiki/SqlMedConnectionManager > I'll update this with an experimental patch. This implements: * System catalogs for FDW, SERVER and USER MAPPING * regserver data type for servers (convert from text

[HACKERS] TABLE command

2008-10-30 Thread Peter Eisentraut
If I read this right, SQL would allow writing TABLE foo; as a top-level command, equivalent to SELECT * FROM foo; (see production ). It can be used whereever a SELECT or VALUES can be used. This is probably about as useless as some of my other recent patches, but the implementation is simpl