title: How to properly insert from stdin in postgresql?
body: <p>normal insert:</p>
  <pre><code>insert into tfreeze(id,s) values(1,'foo');
  </code></pre>
  <p>I tried the following ways, both not working:</p>
  <pre><code>copy tfreeze(id,s ) from stdin;
  1 foo
  \.
  </code></pre>
  <hr />
  <pre><code>copy tfreeze(id,s ) from stdin;
      1 'foo'
      \.
  </code></pre>
  <p>Only a few questions related from stdin in stackoverflow. <a href="https://stackoverflow.com/search?q=Postgres+Insert+statements+from+stdin">https://stackoverflow.com/search?q=Postgres+Insert+statements+from+stdin</a></p>
  <p>--
  error code:</p>
  <pre><code>ERROR:  22P02: invalid input syntax for type integer: &quot;1 foo&quot;
  CONTEXT:  COPY tfreeze, line 1, column id: &quot;1 foo&quot;
  LOCATION:  pg_strtoint32, numutils.c:320
  </code></pre>
  <p>I get code from this(<a href="https://postgrespro.ru/education/books/internals" rel="nofollow noreferrer">https://postgrespro.ru/education/books/internals</a>) book.<br />
  code source: <a href="https://prnt.sc/eEsRZ5AK-tjQ" rel="nofollow noreferrer">https://prnt.sc/eEsRZ5AK-tjQ</a><br />
  So far I tried:<br />
  <code>1, foo</code>,  <code> 1\t'foo'</code>,   <code>1\tfoo</code></p>