sql="select %s,tablename from pg_table_def where tablename like (%s)"
data=("schemaname","abc",)
cur.execute(sql,data)
If I pass a value as described above, then the select takes it as a string. Which is not the intention.
If I try
data=(schemaname,"abc",)
then it shows the error global name 'schemaname' is not defined.