Here's an example session:
powerbook> PG_SCHEMA_SEARCH_PATH="'public','core','objects'" powerbook> export PG_SCHEMA_SEARCH_PATH powerbook> ./psql -d opencce SET Welcome to psql 7.4.1, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit
opencce=# show search_path; search_path ----------------------- public, core, objects (1 row)
opencce=#
The patch is small enough to copy and paste here; I've also attached it to this message.
thanks,
/s.
PATCH:
diff -c -r postgresql-7.4.1/src/bin/psql/startup.c postgresql-7.4.1.mod/src/bin/psql/startup.c
*** postgresql-7.4.1/src/bin/psql/startup.c Mon Sep 29 13:21:33 2003
--- postgresql-7.4.1.mod/src/bin/psql/startup.c Mon Feb 9 17:52:08 2004
***************
*** 98,103 ****
--- 98,105 ----
char *username = NULL; char *password = NULL; + char *potential_SearchPath = NULL; + char *searchpath = NULL; bool need_pass;
setlocale(LC_ALL, ""); *************** *** 209,214 **** --- 211,227 ---- PQsetNoticeProcessor(pset.db, NoticeProcessor, NULL);
SyncVariables();
+
+ /*
+ * Set schema search path from environment
+ */
+
+ potential_SearchPath = getenv("PG_SCHEMA_SEARCH_PATH");
+ if (potential_SearchPath != NULL) {
+ searchpath = (char *) palloc(sizeof("SET SEARCH_PATH TO ") + strlen(potential_SearchPath));
+ sprintf(searchpath, "SET SEARCH_PATH TO %s", potential_SearchPath);
+ successResult = SendQuery(searchpath) ? EXIT_SUCCESS : EXIT_FAILURE;
+ }
if (options.action == ACT_LIST_DB) {
searchpath.patch
Description: Binary data---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster