code: def quote_names(db, names):
      
      c = db.cursor()
      c.execute("SELECT pg_catalog.quote_ident(n) FROM pg_catalog.unnest(%s::text[]) n", [list(names)])
      return [name for (name,) in c]
docs: psycopg2 doesn't know how to quote identifier names, so we ask the server