"Hambleton, John" wrote:
>
> Aloha!
>
> PostgreSQL newbie here!
> Can I store SQL queries after I have started "psql <database>"?
> If so, how is it done? How do I recall the query to use it again?
Aside from "up-arrow" to get previous lines in psql, I thought I saw
something called pgbash somewhere that I thought might possibly have
bash-like command-editing...you might checkout info at
www.postgresql.org. Personally, I switch back and forth between
interactive psql (for big ad hoc cut-n-paste queries from logs), psql
-f filename (for long-standing repeated queries), and psql -c "query"
(for quick ad hoc queries I may want to repeat via bash command-line
editing...
Cheers,
Ed Loehr