Note, I use tabs. Frequently, when I write answers on this site, I write them in vim with the assistance of vim-surround, especially when I'm migrating a fixed-width table/grid to a DDL. Here is an example of one such migration:

CREATE TABLE foo (man_id,subgroup,power,grp) AS VALUES ( 1, 'sub_A', 'positive', 'Group_A' );

Now copy and paste the rendered code into psql and it'll work. But here is the catch. Edit this question (but don't mistakenly change anything), and copy the code block's raw markdown. This is part of a normal workflow, especially if there are knows bugs or typos and you want to fix them. Paste that raw Markdown into psql, and magically you get,

test=# CREATE TABLE foo (man_id,subgroup,power,grp) test-# AS VALUES test-# ( ( 1, 'sub_A', 'positive', 'Group_A' ); test(#

You'll see that the tab went away, and you have this blasted other parenthesis that you can't easily remove. Worse yet you almost have to guess the sequence of characters to get out of it from the prompt,

test(# ) test-# ; ERROR: syntax error at or near "test" LINE 1: test=# CREATE TABLE foo (man_id,subgroup,power,grp) ^

Is there anyway to tell psql to not do anything special here, or to act sanely under these circumstances (copy and paste)? Seems to be the result of the tab, which StackExchange muddles up into spaces on Markdown Rendering, making my life easier for copy-and-paste but more confusing to debug.

My version of psql is built with libedit ,