Re: [PATCHES] [HACKERS] 8.0.0beta5 FailedAssertion (Crash) when casting composite types

2004-12-11 Thread Tom Lane
I have applied the attached patch to HEAD in order to fix the problems
discussed in this thread:
http://archives.postgresql.org/pgsql-hackers/2004-12/msg00187.php

regards, tom lane
Index: src/backend/executor/execQual.c
===
RCS file: /cvsroot/pgsql/src/backend/executor/execQual.c,v
retrieving revision 1.169
diff -c -r1.169 execQual.c
*** src/backend/executor/execQual.c 22 Sep 2004 17:41:50 -  1.169
--- src/backend/executor/execQual.c 11 Dec 2004 16:26:02 -
***
*** 87,92 
--- 87,95 
   bool *isNull, ExprDoneCond *isDone);
  static Datum ExecEvalAnd(BoolExprState *andExpr, ExprContext *econtext,
bool *isNull, ExprDoneCond *isDone);
+ static Datum ExecEvalConvertRowtype(ConvertRowtypeExprState *cstate,
+   
ExprContext *econtext,
+   bool 
*isNull, ExprDoneCond *isDone);
  static Datum ExecEvalCase(CaseExprState *caseExpr, ExprContext *econtext,
 bool *isNull, ExprDoneCond *isDone);
  static Datum ExecEvalCaseTestExpr(ExprState *exprstate,
***
*** 428,434 
   *
   *Returns a Datum whose value is the value of a range
   *variable with respect to given expression context.
!  *  */
  static Datum
  ExecEvalVar(ExprState *exprstate, ExprContext *econtext,
bool *isNull, ExprDoneCond *isDone)
--- 431,438 
   *
   *Returns a Datum whose value is the value of a range
   *variable with respect to given expression context.
!  * 
!  */
  static Datum
  ExecEvalVar(ExprState *exprstate, ExprContext *econtext,
bool *isNull, ExprDoneCond *isDone)
***
*** 1844,1849 
--- 1848,1922 
return BoolGetDatum(!AnyNull);
  }
  
+ /* 
+  *ExecEvalConvertRowtype
+  *
+  *Evaluate a rowtype coercion operation.  This may require
+  *rearranging field positions.
+  * 
+  */
+ static Datum
+ ExecEvalConvertRowtype(ConvertRowtypeExprState *cstate,
+  ExprContext *econtext,
+  bool *isNull, ExprDoneCond *isDone)
+ {
+   HeapTuple   result;
+   Datum   tupDatum;
+   HeapTupleHeader tuple;
+   HeapTupleData tmptup;
+   AttrNumber *attrMap = cstate->attrMap;
+   Datum  *invalues = cstate->invalues;
+   char   *innulls = cstate->innulls;
+   Datum  *outvalues = cstate->outvalues;
+   char   *outnulls = cstate->outnulls;
+   int i;
+   int outnatts = cstate->outdesc->natts;
+ 
+   tupDatum = ExecEvalExpr(cstate->arg, econtext, isNull, isDone);
+ 
+   /* this test covers the isDone exception too: */
+   if (*isNull)
+   return tupDatum;
+ 
+   tuple = DatumGetHeapTupleHeader(tupDatum);
+ 
+   Assert(HeapTupleHeaderGetTypeId(tuple) == cstate->indesc->tdtypeid);
+   Assert(HeapTupleHeaderGetTypMod(tuple) == cstate->indesc->tdtypmod);
+ 
+   /*
+* heap_deformtuple needs a HeapTuple not a bare HeapTupleHeader.
+*/
+   tmptup.t_len = HeapTupleHeaderGetDatumLength(tuple);
+   tmptup.t_data = tuple;
+ 
+   /*
+* Extract all the values of the old tuple, offsetting the arrays
+* so that invalues[0] is NULL and invalues[1] is the first
+* source attribute; this exactly matches the numbering convention
+* in attrMap.
+*/
+   heap_deformtuple(&tmptup, cstate->indesc, invalues + 1, innulls + 1);
+   invalues[0] = (Datum) 0;
+   innulls[0] = 'n';
+ 
+   /*
+* Transpose into proper fields of the new tuple.
+*/
+   for (i = 0; i < outnatts; i++)
+   {
+   int j = attrMap[i];
+ 
+   outvalues[i] = invalues[j];
+   outnulls[i] = innulls[j];
+   }
+ 
+   /*
+* Now form the new tuple.
+*/
+   result = heap_formtuple(cstate->outdesc, outvalues, outnulls);
+ 
+   return HeapTupleGetDatum(result);
+ }
  
  /* 
   *ExecEvalCase
***
*** 2969,2974 
--- 3042,3109 
state = (ExprState *) gstate;
}
break;
+   case T_ConvertRowtypeExpr:
+   {
+   ConvertRowtypeExpr *convert = 

Re: [PATCHES] Update french po files

2004-12-11 Thread Peter Eisentraut
Guillaume LELARGE wrote:
> Here are french .po files. They have been proofreaded.
>
> Please, apply :)

Done.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [PATCHES] PL/Perl document patch

2004-12-11 Thread Peter Eisentraut
David Fetter wrote:
> Please find enclosed a patch to the pl/perl documents that clafies
> the scope of global data and gives an example of storing a code
> reference.

Patch installed.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

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


Re: [PATCHES] [HACKERS] regression script/makefile exit failure

2004-12-11 Thread Andrew Dunstan

Andrew Dunstan wrote:

Peter Eisentraut wrote:
I seem to recall that there is a bug in the FreeBSD shell with line 
breaks in traps.  Try changing the above to

trap 'st=$?; echo status = $st; exit $st' 0
 


Thankyou Peter! I'd never have guessed something so obscure!
I have confirmed that this is the problem, and ascertained that the 
Cygwin shell exhibits the same behaviour.

I will submit a patch for pg_regress.sh shortly (after a little 
testing using buildfarm).


Attached patch has been tested on Cygwin and found to work as expected 
when initdb fails during make check - I don't have access to a FreeBSD 
machine to do a test buildfarm run.

cheers
andrew
Index: src/test/regress/pg_regress.sh
===
RCS file: /home/cvsmirror/pgsql/src/test/regress/pg_regress.sh,v
retrieving revision 1.50
diff -c -r1.50 pg_regress.sh
*** src/test/regress/pg_regress.sh	17 Nov 2004 18:06:04 -	1.50
--- src/test/regress/pg_regress.sh	11 Dec 2004 21:27:40 -
***
*** 238,255 
  # with the result of the last shell command before the `exit'.  Hence
  # we have to write `(exit x); exit' below this point.
  
! trap '
! savestatus=$?
  if [ -n "$postmaster_pid" ]; then
  kill -2 "$postmaster_pid"
  wait "$postmaster_pid"
  unset postmaster_pid
  fi
  rm -f "$TMPFILE" && exit $savestatus
! ' 0
  
! trap '
! savestatus=$?
  echo; echo "caught signal"
  if [ -n "$postmaster_pid" ]; then
  echo "signalling fast shutdown to postmaster with pid $postmaster_pid"
--- 238,257 
  # with the result of the last shell command before the `exit'.  Hence
  # we have to write `(exit x); exit' below this point.
  
! exit_trap(){ 
! savestatus=$1
  if [ -n "$postmaster_pid" ]; then
  kill -2 "$postmaster_pid"
  wait "$postmaster_pid"
  unset postmaster_pid
  fi
  rm -f "$TMPFILE" && exit $savestatus
! }
  
! trap 'exit_trap $?' 0
! 
! sig_trap() {
! savestatus=$1
  echo; echo "caught signal"
  if [ -n "$postmaster_pid" ]; then
  echo "signalling fast shutdown to postmaster with pid $postmaster_pid"
***
*** 258,264 
  unset postmaster_pid
  fi
  (exit $savestatus); exit
! ' 1 2 13 15
  
  
  
--- 260,268 
  unset postmaster_pid
  fi
  (exit $savestatus); exit
! }
! 
! trap 'sig_trap $?' 1 2 13 15
  
  
  

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [PATCHES] Updated Turkish translations for PostgreSQL 8.0

2004-12-11 Thread Peter Eisentraut
Devrim GUNDUZ wrote:
> We've updated the Turkish translations:

Installed.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] Translation updates: 8.0: pg_dump-ru, initdb-ru, psql-ru; 7.4/8.0: postgres-ru

2004-12-11 Thread Peter Eisentraut
Serguei Mokhov wrote:
> Attached please find newer Russian translation updates.

Installed.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] Translation updates: pt_BR

2004-12-11 Thread Peter Eisentraut
Euler Taveira de Oliveira wrote:
> This is a fully reviewed version of pt_BR message files. Please apply
> it to HEAD.

Done.

> This another one, just resolved some fuzzy translations in 7.4.
> Please apply it to 7.4 branch.

Done.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] 8.0 RC1 NLS translate fo zh_CN

2004-12-11 Thread Peter Eisentraut
Weiping wrote:
> Here is the translated string for zh_CN locale.

Installed.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

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


Re: [PATCHES] Assorted spanish translations

2004-12-11 Thread Peter Eisentraut
Alvaro Herrera wrote:
> I attach a tarball with the 10 message catalogs fully translated to
> spanish.

Installed.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 8: explain analyze is your friend


[PATCHES] Updated Turkish translations for PostgreSQL 8.0

2004-12-11 Thread Devrim GUNDUZ
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
We've updated the Turkish translations:
http://postgresql.gunduz.org/translation/PostgreSQL-8.0/PgSQL-DilDosyalari/initdb-tr.po
http://postgresql.gunduz.org/translation/PostgreSQL-8.0/PgSQL-DilDosyalari/pg_config-tr.po
http://postgresql.gunduz.org/translation/PostgreSQL-8.0/PgSQL-DilDosyalari/pg_ctl-tr.po
http://postgresql.gunduz.org/translation/PostgreSQL-8.0/PgSQL-DilDosyalari/pg_dump-tr.po
http://postgresql.gunduz.org/translation/PostgreSQL-8.0/PgSQL-DilDosyalari/postgres-tr.po
http://postgresql.gunduz.org/translation/PostgreSQL-8.0/PgSQL-DilDosyalari/psql-tr.po
Could you please commit them?
Regards,
- --
Devrim GUNDUZ 
devrim~gunduz.orgdevrim.gunduz~linux.org.tr
			http://www.tdmsoft.com
			http://www.gunduz.org
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBuvMBtl86P3SPfQ4RAhmKAKDlIyu9euRtjPlfjqPZVr2T7N+eZQCg0YLZ
omNH7GJWQ/5I5MHUMkZPa+0=
=IgmP
-END PGP SIGNATURE-
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster