psycopg2 copy_from raises asynchronous ProgrammingError with sync connection in celery task
<p>My problem is I am facing</p>

<blockquote>
  <p>ProgrammingError: copy_from cannot be used with an asynchronous
  callback.</p>
</blockquote>

<p>while trying to <code>copy_from</code> without async connection. This must be stated, I am creating connection from a celery task. Can someone give me a clue how sqlalchemy or celery or whatever forces my psycopg2 connection behave like async?</p>

<pre><code>conn = psycopg2.connect(con_string)
conn.async
&gt;&gt;0
cur = conn.cursor()    
data = BytesIO()
data.write('\n'.join(['Tom\tJenkins\t37',
                  'Madonna\t\N\t45',
                  'Federico\tDi Gregorio\t\N']))
data.seek(0)
curs.copy_from(data, 'test_copy')
</code></pre>