[PATCHES] win32 client build patch

2006-10-10 Thread Hiroshi Saito

Hi Bruce-san.

This is required in spite of being legacy.
Please apply it.(this is the situation of current cvs.)

Thanks.

Regards,
Hiroshi Saito

win32_patch
Description: Binary data

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [PATCHES] test: please ignore

2006-10-10 Thread Magnus Hagander
 I've posted a 6.5kB patch (as an attachment) three times over the
 past few days but haven't seen it hit the lists. Checking to see if
 this goes through.

Did you by any chance gzip it? IIRC, mails with gzipped attachments are
silently dropped on- patches for some reason. (Can't remember if it was
all gzip or just tar.gz, but it was dropped. You can find a discussion
about it in the archives around when i posted the msvc build patch
stuff, sometime this summer a couple of days after the conference)

//Magnus


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] [PATCHES] test: please ignore

2006-10-10 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes:
 I've posted a 6.5kB patch (as an attachment) three times over the
 past few days but haven't seen it hit the lists. Checking to see if
 this goes through.

 Did you by any chance gzip it? IIRC, mails with gzipped attachments are
 silently dropped on- patches for some reason.

Hm?  They've always worked fine for me, and for a lot of other people.
You should ask Marc to look into this.

regards, tom lane

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] [PATCHES] test: please ignore

2006-10-10 Thread Alvaro Herrera
Tom Lane wrote:
 Magnus Hagander [EMAIL PROTECTED] writes:
  I've posted a 6.5kB patch (as an attachment) three times over the
  past few days but haven't seen it hit the lists. Checking to see if
  this goes through.
 
  Did you by any chance gzip it? IIRC, mails with gzipped attachments are
  silently dropped on- patches for some reason.
 
 Hm?  They've always worked fine for me, and for a lot of other people.
 You should ask Marc to look into this.

It depends on the MIME type IIRC.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [PATCHES] win32 client build patch

2006-10-10 Thread Bruce Momjian

Patch applied.  Thanks.

---


Hiroshi Saito wrote:
 Hi Bruce-san.
 
 This is required in spite of being legacy.
 Please apply it.(this is the situation of current cvs.)
 
 Thanks.
 
 Regards,
 Hiroshi Saito
[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[PATCHES] Constraint trigger doc patch

2006-10-10 Thread Michael Glaesemann

(Fifth attempt: diff inline)
(And a fourth attempt, from another account...)
(Third time's the charm?)
(Resent as I sent this yesterday but haven't seen it on the list yet  
or in the online archives. Apologies if it ends up double-posting.)


Please find attached a doc patch for CREATE CONSTRAINT TRIGGER. The  
documentation here has always been sparse, as the command isn't  
intended for general use. However, in its current form its a bit  
*too* sparse. For example, it mentions constraint attributes but  
doesn't say what those might be or where to look for information for  
details. The patch lists attribute options and provides references to  
where those options are described.


When looking in gram.y while trying to figure out what exactly was  
meant by actual constraint specification, I discovered  
OptConstrFromTable. I assume this means Optional Constraint From  
Table and it looks like it's used to specify the referenced table a  
foreign key constraint. I couldn't figure out how to meaningfully use  
it and have left the description purposefully vague.


I don't have a working DocBook tool chain on my system, so I haven't  
been able to check if it builds properly. I tried to be conscientious  
about my formatting, but some SGML bugs may have crept in.


Thanks!

Michael Glaesemann
grzm myrealbox com

Index: doc/src/sgml/ref/create_constraint.sgml
===
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/ 
create_constraint.sgml,v

retrieving revision 1.14
diff -c -r1.14 create_constraint.sgml
*** doc/src/sgml/ref/create_constraint.sgml	16 Sep 2006 00:30:17  
-	1.14

--- doc/src/sgml/ref/create_constraint.sgml 7 Oct 2006 03:53:18 -
***
*** 21,29 
   refsynopsisdiv
  synopsis
  CREATE CONSTRAINT TRIGGER replaceable class=parametername/ 
replaceable

! AFTER replaceable class=parameterevents/replaceable ON
! replaceable class=parametertablename/replaceable  
replaceable class=parameterconstraint/replaceable replaceable  
class=parameterattributes/replaceable
! FOR EACH ROW EXECUTE PROCEDURE replaceable  
class=parameterfuncname/replaceable ( replaceable  
class=parameterargs/replaceable )

  /synopsis
   /refsynopsisdiv

--- 21,32 
   refsynopsisdiv
  synopsis
  CREATE CONSTRAINT TRIGGER replaceable class=parametername/ 
replaceable
! AFTER replaceable class=parameterevent [ OR ... ]/ 
replaceable

! ON replaceable class=parametertable_name/replaceable
! [ FROM replaceable class=parameterreferenced_table_name/ 
replaceable ]
! { NOT DEFERRABLE | [ DEFERABBLE ] { INITIALLY IMMEDIATE |  
INITIALLY DEFERRED } }

! FOR EACH ROW
! EXECUTE PROCEDURE replaceable class=parameterfuncname/ 
replaceable ( replaceable class=parameterarguments/replaceable )

  /synopsis
   /refsynopsisdiv

***
*** 33,102 
para
 commandCREATE CONSTRAINT TRIGGER/command is used within
 commandCREATE TABLE/command/commandALTER TABLE/command  
and by
!applicationpg_dump/application  to  create  the  special   
triggers  for

!referential  integrity.
 It is not intended for general use.
/para
   /refsect1

   refsect1
!titleParameters/title
!   
! variablelist
!  varlistentry
!   termreplaceable class=PARAMETERname/replaceable/term
!   listitem
!para
!   The name of the constraint trigger.
!/para
!   /listitem
!  /varlistentry
!
!  varlistentry
!   termreplaceable class=PARAMETERevents/replaceable/term
!   listitem
!para
!   The event categories for which this trigger should be fired.
!/para
!   /listitem
!  /varlistentry
!
!  varlistentry
!   termreplaceable class=PARAMETERtablename/replaceable/ 
term

!   listitem
!para
!   The name (possibly schema-qualified) of the table in which
!   the triggering events occur.
!/para
!   /listitem
!  /varlistentry
!
!  varlistentry
!   termreplaceable class=PARAMETERconstraint/ 
replaceable/term

!   listitem
!para
!   Actual constraint specification.
!/para
!   /listitem
!  /varlistentry
!
!  varlistentry
!   termreplaceable class=PARAMETERattributes/ 
replaceable/term

!   listitem
!para
!   The constraint attributes.
!/para
!   /listitem
!  /varlistentry
!
!  varlistentry
!   termreplaceable class=PARAMETERfuncname/replaceable 
(replaceable class=PARAMETERargs/replaceable)/term

!   listitem
!para
!   The function to call as part of the trigger processing.
!/para
!   /listitem
!  /varlistentry
! /variablelist
   /refsect1
  /refentry
--- 36,128 
para
 commandCREATE CONSTRAINT TRIGGER/command is used within
 commandCREATE TABLE/command/commandALTER TABLE/command  
and by
!applicationpg_dump/application to create the special  
triggers 

[PATCHES] array_accum aggregate

2006-10-10 Thread Stephen Frost
Greetings,

  Please find below a patch to add the array_accum aggregate as a
  built-in using two new C functions defined in array_userfuncs.c.
  These functions simply expose the pre-existing efficient array
  building routines used elsewhere in the backend (accumArrayResult
  and makeArrayResult, specifically).   An array_accum aggregate has
  existed in the documentation for quite some time using the
  inefficient (for larger arrays) array_append routine.  The
  documentation around the example has also been updated to reflect
  the addition of this built-in.

  Documentation and a regression test are also included.

Thanks,

Stephen

Index: doc/src/sgml/func.sgml
===
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/func.sgml,v
retrieving revision 1.343
diff -c -r1.343 func.sgml
*** doc/src/sgml/func.sgml  1 Oct 2006 18:54:31 -   1.343
--- doc/src/sgml/func.sgml  11 Oct 2006 04:38:45 -
***
*** 7851,7856 
--- 7851,7872 
   row
entry
 indexterm
+ primaryarray_accum/primary
+/indexterm
+functionarray_accum(replaceable 
class=parameteranyelement/replaceable)/function
+   /entry
+   entry
+typeanyelement/type
+   /entry
+   entry
+ array of elements of same type as argument type
+   /entry
+   entryan array of all input elements (NULLs, non-nulls, and 
duplicates)/entry
+  /row
+ 
+  row
+   entry
+indexterm
  primaryaverage/primary
 /indexterm
 functionavg(replaceable 
class=parameterexpression/replaceable)/function
Index: doc/src/sgml/xaggr.sgml
===
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/xaggr.sgml,v
retrieving revision 1.33
diff -c -r1.33 xaggr.sgml
*** doc/src/sgml/xaggr.sgml 16 Sep 2006 00:30:16 -  1.33
--- doc/src/sgml/xaggr.sgml 11 Oct 2006 04:38:45 -
***
*** 132,138 
  /programlisting
  
 Here, the actual state type for any aggregate call is the array type
!having the actual input type as elements.
/para
  
para
--- 132,141 
  /programlisting
  
 Here, the actual state type for any aggregate call is the array type
!having the actual input type as elements.  Note: array_accum() is now
!a built-in aggregate which uses a much more efficient mechanism than
!that which is provided by array_append, prior users of array_accum()
!may be pleasantly suprised at the marked improvment for larger arrays.
/para
  
para
Index: src/backend/utils/adt/array_userfuncs.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/utils/adt/array_userfuncs.c,v
retrieving revision 1.20
diff -c -r1.20 array_userfuncs.c
*** src/backend/utils/adt/array_userfuncs.c 14 Jul 2006 14:52:23 -  
1.20
--- src/backend/utils/adt/array_userfuncs.c 11 Oct 2006 04:38:46 -
***
*** 15,20 
--- 15,22 
  #include utils/array.h
  #include utils/builtins.h
  #include utils/lsyscache.h
+ #include utils/memutils.h
+ #include nodes/execnodes.h
  
  
  
/*-
***
*** 399,404 
--- 401,516 
PG_RETURN_ARRAYTYPE_P(result);
  }
  
+ /* Structure, used by aaccum_sfunc and aaccum_ffunc to
+  * implement the array_accum() aggregate, for storing 
+  * pointers to the ArrayBuildState for the array we are 
+  * building and the MemoryContext in which it is being
+  * built.  Note that this structure is 
+  * considered an 'anyarray' externally, which is a
+  * variable-length datatype, and therefore
+  * must open with an int32 defining the length. */
+ typedef struct {
+   int32vl_len;
+   ArrayBuildState *astate;
+   MemoryContextarrctx;
+ } aaccum_info;
+ 
+ 
/*-
+  * aaccum_sfunc :
+  *  State transistion function for the array_accum() aggregate,
+  *  efficiently builds an in-memory array by working in blocks and
+  *  minimizing realloc()'s and copying of the data in general.
+  *  Creates a seperate memory context attached to the AggContext into
+  *  which the array is built.  That context is free'd when the final
+  *  function is called (aaccum_ffunc).  accumArrayResult() does all
+  *  the heavy lifting here, this is really just a glue function.
+  *
+  */
+ Datum
+ aaccum_sfunc(PG_FUNCTION_ARGS)
+ {
+   aaccum_info *ainfo;
+   AggState*aggstate;
+ 
+   /* Make sure we are being called in an aggregate. */
+   if (!fcinfo-context || !IsA(fcinfo-context, AggState))
+