title: is there a difference between `quote_ident()` and parametized queries in psycopg2?
body: <p>In python3 and postgresql12, is there a safety difference between parametizing SQL queries the "proper" way or just escaping potentially dangerous content using <code>psycopg2.quote_ident()</code>?</p>
  
  <p>For example, consider these two options.</p>
  
  <p><em>Option 1:</em></p>
  
  <pre class="lang-py prettyprint-override"><code>name = get_unsafe_input_from_web_form()
  cursor.execute("SELECT * FROM students WHERE name = %s;", (name,))
  </code></pre>
  
  <p><em>Option 2:</em></p>
  
  <pre class="lang-py prettyprint-override"><code>from psycopg2.extensions import quote_ident
  
  name = get_unsafe_input_from_web_form()
  cursor.execute(f"SELECT * FROM students WHERE name = {quote_ident(name, cursor)};"
  </code></pre>
  
  <p>The <a href="https://www.psycopg.org/docs/extensions.html?#psycopg2.extensions.quote_ident" rel="nofollow noreferrer">documentation</a> is not particularly explicit.  Is Option 2 totally equivalent in terms of safety against injection attacks?</p>