[PATCHES] win32 int/float test fixes

2004-02-24 Thread Claudio Natoli

For application to HEAD, following community review.

Corrects the int8/float4/float8 tests under win32.

Cheers,
Claudio

P.S. Starting to back up on win32 related changes. If someone could look at
the patch/es I've got waiting for application (and either apply 'em or let
me know what fixes are required), I'd appreciate it...

--- 
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see 
a
href=http://www.memetrics.com/emailpolicy.html;http://www.memetrics.com/em
ailpolicy.html/a
  



resultmap.diff
Description: Binary data


float8-exp-three-digits-win32.out
Description: Binary data


int8-exp-three-digits-win32.out
Description: Binary data

---(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


[PATCHES] Turkish translation of FAQ

2004-02-24 Thread Devrim GUNDUZ
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Hi,

I've sent Turkish translations of FAQ yesterdat; in html and text
formats, but the mail wasn't delivered to the list.

To save bandwidth, I'll not be attaching the files to this mail. Here is 
the URL:

http://www.gunduz.org/seminer/pg/PostgreSQL-FAQ-Turkish.tar.gz

Could you please apply them to CVS?
 
Regards,
- -- 
Devrim GUNDUZ  
[EMAIL PROTECTED]   [EMAIL PROTECTED] 
http://www.TDMSoft.com
http://www.gunduz.org
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAO1JZtl86P3SPfQ4RAiU1AJ9ex2IjCmvIYbStGr5meJoEY5y+6QCfa8sG
CN0l/lqtNUZq9dwAsnXXZQM=
=oepu
-END PGP SIGNATURE-


---(end of broadcast)---
TIP 3: 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


[PATCHES] dollar quoting with flex

2004-02-24 Thread Andrew Dunstan
(Fourth try ;-)

Attached is a patch for dollar quoting in the backend and in psql (with 
the new flex scanner). I'm fairly confident about the backend (because 
this is mainly Tom's work adapted :-) ) but rather less so about psql - 
I don't entirely understand all the odd states in psql's scanner. I'm 
not sure that I have freed up memory in all the necessary cases. Nor am 
I sure what the state is or should be if we end an included file in a 
dollar-quoting state, nor how to handle such a situation. So, some extra 
eyeballs would be appreciated.

However - it does seem to work in my simple testing.

If this is all OK, the remaining tasks would include pg_dump, docs (Jon 
Jensen says he will attack these two) and some regression tests (any 
volunteers?)

cheers

andrew
Index: src/backend/parser/scan.l
===
RCS file: /projects/cvsroot/pgsql-server/src/backend/parser/scan.l,v
retrieving revision 1.114
diff -c -r1.114 scan.l
*** src/backend/parser/scan.l   21 Feb 2004 00:34:52 -  1.114
--- src/backend/parser/scan.l   24 Feb 2004 17:33:01 -
***
*** 37,42 
--- 37,43 
  extern YYSTYPE yylval;
  
  static intxcdepth = 0;/* depth of nesting in slash-star comments */
+ static char*dolqstart;  /* current $foo$ quote start string */
  
  /*
   * literalbuf is used to accumulate literal values when multiple rules
***
*** 94,99 
--- 95,101 
   *  xd delimited identifiers (double-quoted identifiers)
   *  xh hexadecimal numeric string
   *  xq quoted strings
+  *  dolq $foo$ quoted strings
   */
  
  %x xb
***
*** 101,106 
--- 103,109 
  %x xd
  %x xh
  %x xq
+ %x dolq
  
  /*
   * In order to make the world safe for Windows and Mac clients as well as
***
*** 175,180 
--- 178,194 
  xqoctesc  [\\][0-7]{1,3}
  xqcat {quote}{whitespace_with_newline}{quote}
  
+ /* $foo$ style quotes (dollar quoting)
+  * The quoted string starts with $foo$ where foo is an optional string
+  * in the form of an identifier, except that it may not contain $, 
+  * and extends to the first occurrence of an identical string.  
+  * There is *no* processing of the quoted text.
+  */
+ dolq_start[A-Za-z\200-\377_]
+ dolq_cont [A-Za-z\200-\377_0-9]
+ dolqdlm \$({dolq_start}{dolq_cont}*)?\$
+ dolqins [^$]+
+ 
  /* Double quote
   * Allows embedded spaces and other special characters into identifiers.
   */
***
*** 242,248 
  other .
  
  /*
!  * Quoted strings must allow some special characters such as single-quote
   *  and newline.
   * Embedded single-quotes are implemented both in the SQL standard
   *  style of two adjacent single quotes '' and in the Postgres/Java style
--- 256,263 
  other .
  
  /*
!  * Dollar quoted strings are totally opaque, and no escaping is done on them.
!  * Other quoted strings must allow some special characters such as single-quote
   *  and newline.
   * Embedded single-quotes are implemented both in the SQL standard
   *  style of two adjacent single quotes '' and in the Postgres/Java style
***
*** 390,395 
--- 405,439 
}
  xqEOF   { yyerror(unterminated quoted string); }
  
+ {dolqdlm}   {
+   token_start = yytext;
+   dolqstart = pstrdup(yytext);
+   BEGIN(dolq);
+   startlit();
+ }
+ dolq{dolqdlm} {
+ if (strcmp(yytext, dolqstart) == 0)
+   {
+   pfree(dolqstart);
+   BEGIN(INITIAL);
+   yylval.str = litbufdup();
+   return SCONST;
+   }
+   /*
+* When we fail to match $...$ to dolqstart, 
transfer
+* the $... part to the output, but put back 
the final
+* $ for rescanning.  Consider 
$delim$...$junk$delim$
+*/
+   addlit(yytext, yyleng-1); 
+   yyless(yyleng-1); 
+ }
+ dolq{dolqins} {
+ addlit(yytext, yyleng);
+ }
+ dolq. {
+   addlitchar(yytext[0]);
+ }
+ dolqEOF   { yyerror(unterminated dollar-quoted string); }
  {xdstart} {
token_start = yytext;
BEGIN(xd);
***
*** 407,413 
   

Re: [PATCHES] dollar quoting with flex

2004-02-24 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes:
 Attached is a patch for dollar quoting in the backend and in psql (with 
 the new flex scanner). I'm fairly confident about the backend (because 
 this is mainly Tom's work adapted :-) ) but rather less so about psql - 
 I don't entirely understand all the odd states in psql's scanner. I'm 
 not sure that I have freed up memory in all the necessary cases. Nor am 
 I sure what the state is or should be if we end an included file in a 
 dollar-quoting state, nor how to handle such a situation. So, some extra 
 eyeballs would be appreciated.

I'll take a look soon.  The psql behavior is that a new lexer is
instantiated for each include-file level, which means that quoting
states can't persist across file boundaries.  This emulates the behavior
of the old handmade lexing code, and seems fairly reasonable to me.
(By definition, you weren't in a quoting state when you recognized the
\i command, and so you shouldn't be when you come out of the include
file.)  We could argue about that if people want to reconsider it, but
it seems orthogonal to the dollar-quoting change to me.

regards, tom lane

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [PATCHES] dollar quoting with flex

2004-02-24 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes:
 Attached is a patch for dollar quoting in the backend and in psql (with 
 the new flex scanner).

Applied with minor fixes.

 If this is all OK, the remaining tasks would include pg_dump, docs (Jon 
 Jensen says he will attack these two) and some regression tests (any 
 volunteers?)

I think plpgsql's lexer also needs to be taught about dollar-quoting.

regards, tom lane

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


[PATCHES] 1-line fix to port/thread.c for compiling libpq with Borland C

2004-02-24 Thread L J Bayuk
Below please find a tiny patch to PostgreSQL-7.4.1 src/port/thread.c that I
found was necessary to compile libpq on Windows using Borland C++ Builder.
The patch causes the the WIN32 code to be included, and pwd.h skipped, if
under either WIN32 compiler, rather than just with MSVC.
(Alternative is to just use #if defined(WIN32), which works for me, but
I don't know if that would be safe.)


*** src/port/thread.c.orig  Mon Nov 24 08:11:27 2003
--- src/port/thread.c   Tue Feb 24 19:19:35 2004
***
*** 16,22 
  
  #include sys/types.h
  #include errno.h
! #if defined(WIN32)  defined(_MSC_VER)
  #undef ERROR
  #else
  #include pwd.h
--- 16,22 
  
  #include sys/types.h
  #include errno.h
! #if defined(WIN32)  (defined(_MSC_VER) || defined(__BORLANDC__))
  #undef ERROR
  #else
  #include pwd.h


---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings