mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Translate ENOMEM to ERRCODE_OUT_OF_MEMORY in errcode_for_file_access().
Previously you got ERRCODE_INTERNAL_ERROR, which seems inappropriate, especially given that we're trying to avoid emitting that in reachable cases. Alexander Kuzmenkov Discussion: https://postgr.es/m/CALzhyqzgQph0BY8-hFRRGdHhF8CoqmmDHW9S=hMZ-HMzLxRqDQ@mail.gmail.com
This commit is contained in:
		@@ -922,6 +922,10 @@ errcode_for_file_access(void)
 | 
				
			|||||||
			edata->sqlerrcode = ERRCODE_DISK_FULL;
 | 
								edata->sqlerrcode = ERRCODE_DISK_FULL;
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							case ENOMEM:			/* Out of memory */
 | 
				
			||||||
 | 
								edata->sqlerrcode = ERRCODE_OUT_OF_MEMORY;
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		case ENFILE:			/* File table overflow */
 | 
							case ENFILE:			/* File table overflow */
 | 
				
			||||||
		case EMFILE:			/* Too many open files */
 | 
							case EMFILE:			/* Too many open files */
 | 
				
			||||||
			edata->sqlerrcode = ERRCODE_INSUFFICIENT_RESOURCES;
 | 
								edata->sqlerrcode = ERRCODE_INSUFFICIENT_RESOURCES;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user