(unnamed)

text/plain

Filename: (unnamed)
Type: text/plain
Part: 0
Message: Re: [GENERAL] to_timestamp() and quartersf
Index: src/backend/utils/adt/formatting.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v
retrieving revision 1.168
diff -c -c -r1.168 formatting.c
*** src/backend/utils/adt/formatting.c	26 Feb 2010 02:01:08 -0000	1.168
--- src/backend/utils/adt/formatting.c	3 Mar 2010 17:18:43 -0000
***************
*** 2671,2685 ****
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_Q:
! 
! 				/*
! 				 * We ignore Q when converting to date because it is not
! 				 * normative.
! 				 *
! 				 * We still parse the source string for an integer, but it
! 				 * isn't stored anywhere in 'out'.
! 				 */
! 				from_char_parse_int((int *) NULL, &s, n);
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_CC:
--- 2671,2684 ----
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_Q:
! 				/* Honor "Q" only if a month has not previously be set */
! 				if (out->mm == 0)
! 				{
! 					from_char_parse_int(&out->mm, &s, n);
! 					out->mm = (out->mm - 1) * 3 + 1;
! 				}
! 				else	/* ignore */
! 					from_char_parse_int((int *) NULL, &s, n);
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_CC: