0

I have currently written the logic in MYSQL using python and it's working without any errors. I am trying to replicate the same on POSTGRESQL. Please find the code below:

MYSQL CODE

db_cursor.execute("INSERT INTO table1 SELECT * FROM table2 ON DUPLICATE KEY UPDATE col1=VALUES(col1), col2=VALUES(col2)")

POSTGRESQL CODE

db_cursor.execute("INSERT INTO table1 SELECT * FROM table2 ON DUPLICATE KEY UPDATE col1=SELECT(col1), col2=SELECT(col2)")

I am getting the following error while trying to execute the POSTGRESQL code:

TypeError: function missing required argument 'vars_list' (pos 2)
Shadow
  • 33,525
  • 10
  • 51
  • 64
Rajat
  • 1
  • Please [edit] your question to include the _complete_ error traceback, and tag the question with the package that you are using for the database connection. – snakecharmerb Jun 05 '21 at 07:39
  • @Rajat can you share python code. Manly function where this code is written. – krishna Jun 05 '21 at 07:40

0 Answers0