/pgpatches/quarter2

text/x-diff

Filename: /pgpatches/quarter2
Type: text/x-diff
Part: 0
Message: Re: [GENERAL] to_timestamp() and quarters

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
src/backend/utils/adt/formatting.c 4 10
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:06:59 -0000
***************
*** 2671,2686 ****
  				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:
  				from_char_parse_int(&out->cc, &s, n);
--- 2671,2680 ----
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_Q:
! 				/* It is unclear which date in the quarter to return. */
! 				ereport(ERROR,
! 						(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
! 						 errmsg("\"Q\" format is not supported in to_date")));
  				break;
  			case DCH_CC:
  				from_char_parse_int(&out->cc, &s, n);