I keep getting this
error: psycopg2.ProgrammingError: column "someentry" does not exist.
The error indicates that the column someentry
does not exist when someentry
is not a column it's just a value to enter into the db.
Here is the code that gives the error:
cur.execute('INSERT INTO {0!s} (ip_id, item) VALUES ({1!s}{2!s})'.format('mytable',1,'someentry'))
Here is how I create my table:
tablename = 'mytable'
command = """
CREATE TABLE IF NOT EXISTS {} (
ip_id SERIAL PRIMARY KEY,
item VARCHAR(255) NOT NULL
)
""".format(tablename)
cur.execute(command)