سؤال

I started to use psycopg2 to connect my little python script to a PostgreSQL database few days ago. After some research I found that a lot of database connector, like psycopg, work using cursors.

I know what is a cursor and how to use it. But I still wonder if it's safe to use the same cursor all along the script life.

Is it safe?

Or would it be preferable to use a different cursor for each query?

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى softwareengineering.stackexchange
scroll top