I was trying to run a psql script today against a database today. This script was schema agnostic. (There were table creations and function creations but none of them contained the specific schema to create them in...)
I wanted to connect to a DB and then insert that new DDL into a "specific" schema. Because psql does not have a schema switch, I had to do it this way...
sed -e '1i\\n SET search_path to contrib;\n' < /usr/local/pgsql-8.2.0/share/contrib/tsearch2.sql | psql -dtemplate1 -p5433 -Upostgres
I would have liked to do it this way... psql -dtemplate1 -p5433 -Upostgres -Xcontrib (I put an X there because "S" was already taken. It could be any letter...)
---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly