Index: src/backend/utils/adt/ruleutils.c
===================================================================
RCS file: /repositories/postgreshome/cvs/pgsql/src/backend/utils/adt/ruleutils.c,v
retrieving revision 1.266
diff -c -r1.266 ruleutils.c
*** src/backend/utils/adt/ruleutils.c	1 Dec 2007 23:44:44 -0000	1.266
--- src/backend/utils/adt/ruleutils.c	19 Dec 2007 11:11:17 -0000
***************
*** 779,793 ****
  			/* if it supports sort ordering, report DESC and NULLS opts */
  			if (opt & INDOPTION_DESC)
  			{
! 				appendStringInfo(&buf, " DESC");
! 				/* NULLS FIRST is the default in this case */
! 				if (!(opt & INDOPTION_NULLS_FIRST))
! 					appendStringInfo(&buf, " NULLS LAST");
  			}
  			else
  			{
! 				if (opt & INDOPTION_NULLS_FIRST)
! 					appendStringInfo(&buf, " NULLS FIRST");
  			}
  		}
  	}
--- 779,799 ----
  			/* if it supports sort ordering, report DESC and NULLS opts */
  			if (opt & INDOPTION_DESC)
  			{
! 				if (!colno || colno == keyno + 1)
! 				{
! 					appendStringInfo(&buf, " DESC");
! 					/* NULLS FIRST is the default in this case */
! 					if (!(opt & INDOPTION_NULLS_FIRST))
! 						appendStringInfo(&buf, " NULLS LAST");
! 				}
  			}
  			else
  			{
! 				if (!colno || colno == keyno + 1)
! 				{
! 					if (opt & INDOPTION_NULLS_FIRST)
! 						appendStringInfo(&buf, " NULLS FIRST");
! 				}
  			}
  		}
  	}
