mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 10:30:33 +03:00 
			
		
		
		
	Provide environment overrides for psql file locations.
PSQL_HISTORY provides an alternative for the command history file, and PSQLRC provides an alternative location for the .psqlrc file.
This commit is contained in:
		| @@ -285,6 +285,15 @@ initializeInput(int flags) | ||||
| 		history_lines_added = 0; | ||||
|  | ||||
| 		histfile = GetVariable(pset.vars, "HISTFILE"); | ||||
|  | ||||
| 		if (histfile == NULL) | ||||
| 		{ | ||||
| 			char * envhist; | ||||
| 			envhist = getenv("PSQL_HISTORY"); | ||||
| 			if (envhist != NULL && strlen(envhist) > 0) | ||||
| 				histfile = envhist; | ||||
| 		} | ||||
|  | ||||
| 		if (histfile == NULL) | ||||
| 		{ | ||||
| 			if (get_home_path(home)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user