Postgres SQL (Amazon Redshift) Run Commands on Startup
-
21-12-2019 - |
Question
I have a set of commands that I run every time I login into psql. How can I run these commands automatically on psql startup?
The commands include:
\timing
set search_path=public,latitude;
Redshift uses psql (8.4.18, server 8.0.2)
Solution
psql
has a .psqlrc
file for just this purpose.
See the relevant PostgreSQL manual, which discusses the .psqlrc
. It's unlikely that Amazon has changed this.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow