I have several cases where I want to collect data in a field. This happens in situations where I do not always have access to my postgres database.
To keep things in sync, it would be great if I could use psycopg2 functions offline to generate queries that could be contained, and as soon as I could connect to the database; handle everything that is held back.
One thing that I am facing right now is that the psycopg2 cursor requires a connection to be created.
My question is:
Is there a way to use the cursor to perform actions like mogrify without an active connection object? Or a connection object that is not connected to a database? Then I would like to temporarily write mogrify results so that they can be processed later.
It seems to be easier and more universal to store data that will be added later to another structure. Perhaps the csv file. Then, when you connect, you can go through this table, but you can also easily do other things with this CSV, if necessary.
This would be a fragile approach, since the connection is used to detect some parameters used for escaping (encoding, standard string, etc.).
" mogrify" psycopg2.extensions.adapt(x).getquoted() , Python %.
psycopg2.extensions.adapt(x).getquoted()
%
psycopg ( 2.3.2) None → NULL. , None: , .
None
NULL
Source: https://habr.com/ru/post/1789596/More articles:comparing QTest with other structures - c ++Help understanding applications with multiple Cocoa controllers - objective-cSpring Безопасность 3.x: создание собственного поставщика проверки подлинности без UserDetailsService - javaIf you ever get weird syntax errors in R.java file, check this problem - androidThe basics of NDK and OpenGL for Android - androidhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1789597/validating-a-file-is-what-it-claims-to-be-by-its-file-extension&usg=ALkJrhhsUFvOAUhmzlPVPvGI6e_qYIdKbgRead the entire file, then print when editing in place? - perlVideo. Use VideoView / MediaPlayer, or intention. Capturing and selecting a user? - androidHow to get jqGrid Search column type when doing a search? - jqueryWhat are the values for the country field in Active Directory? - active-directoryAll Articles