title: psycopg2 syntax error at or near "UPDATE"
body: <p>I've read some q&amp;a about &quot;syntax error at or near&quot; but none could solve my issue.</p>
  <p>A sample of the error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  psycopg2.ProgrammingError: syntax error at or near &quot;UPDATE&quot;
  LINE 1: DECLARE &quot;teste&quot; CURSOR WITHOUT HOLD FOR UPDATE applicant SET...
                                                  ^
  </code></pre>
  <p>Please, note the <code>^</code> right on the <code>UPDATE</code>. I've tested the update script on <code>pgadmin 4</code> and everything worked fine.</p>
  <p>The script is really simple:</p>
  <pre><code>UPDATE applicant
  SET cv_entities = %s
  WHERE id = %s
  </code></pre>
  <p>My code is basically:</p>
  <pre><code>def _connect_database():
      return psy.connect(
          dbname=settings.DATABASE['DBNAME'],
          host=settings.DATABASE['HOST'],
          port=settings.DATABASE['PORT'],
          user=settings.DATABASE['USER'],
          password=settings.DATABASE['PASSWORD'],
          application_name=settings.env
      )
  
  # Connects to database
  conn = _connect_database()
  # Creats a named cursor
  cur = conn.cursor('test')
  
  # Execute
  cur.execute(update_script, ('{&quot;json&quot;: &quot;test&quot;}', '11125ba0-748f-11e8-b1d0-d8108ee3at21'))
  </code></pre>
  <p>I've explicitly written the script on the execute method as well as the parameters, but I still get the same error:</p>
  <pre><code>cur.execute(&quot;UPDATE applicant SET cv_entities = 'json here' WHERE id = '11125ba0-748f-11e8-b1d0-d8108ee3at21'&quot;)
  </code></pre>
  <p>Note that I even removed the double quotes from the first parameter ('json here')</p>
  <p>Am I missing something?!</p>