I wish to list all the column names of a table using psycopg2
package of Python (2.7). But I am unable to execute the following query -
cur.execute("\d my_table");
psycopg2.ProgrammingError: syntax error at or near "\"
Is there an alternate as to how I can list the column names of a table using psycopg2
? Please point out any duplicates. Thanks !