mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Support FETCH FIRST WITH TIES
WITH TIES is an option to the FETCH FIRST N ROWS clause (the SQL standard's spelling of LIMIT), where you additionally get rows that compare equal to the last of those N rows by the columns in the mandatory ORDER BY clause. There was a proposal by Andrew Gierth to implement this functionality in a more powerful way that would yield more features, but the other patch had not been finished at this time, so we decided to use this one for now in the spirit of incremental development. Author: Surafel Temesgen <surafel3000@gmail.com> Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org> Reviewed-by: Tomas Vondra <tomas.vondra@2ndquadrant.com> Discussion: https://postgr.es/m/CALAY4q9ky7rD_A4vf=FVQvCGngm3LOes-ky0J6euMrg=_Se+ag@mail.gmail.com Discussion: https://postgr.es/m/87o8wvz253.fsf@news-spur.riddles.org.uk
This commit is contained in:
		@@ -826,4 +826,17 @@ typedef enum OnConflictAction
 | 
			
		||||
	ONCONFLICT_UPDATE			/* ON CONFLICT ... DO UPDATE */
 | 
			
		||||
} OnConflictAction;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * LimitOption -
 | 
			
		||||
 *	LIMIT option of query
 | 
			
		||||
 *
 | 
			
		||||
 * This is needed in both parsenodes.h and plannodes.h, so put it here...
 | 
			
		||||
 */
 | 
			
		||||
typedef enum LimitOption
 | 
			
		||||
{
 | 
			
		||||
	LIMIT_OPTION_COUNT,			/* FETCH FIRST... ONLY */
 | 
			
		||||
	LIMIT_OPTION_WITH_TIES,		/* FETCH FIRST... WITH TIES */
 | 
			
		||||
	LIMIT_OPTION_DEFAULT,		/* No limit present */
 | 
			
		||||
} LimitOption;
 | 
			
		||||
 | 
			
		||||
#endif							/* NODES_H */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user