Print The Query Buffer In psql
I'll often be composing a PostgreSQL query in Vim and decide I want to give it a try in psql
. I copy the relevant snippet of SQL to my system buffer and then paste into psql
. I'm usually hit with a mess of text like this though:
Yikes. That's not readable. Fortunately, psql
provides a command for printing the current contents of the query buffer. By typing \p
I'll see a more readable version of what I just pasted in.
After taking another glance at the snippet of SQL, I decide to complete the query to create my new table.
Last updated