Huhn Hur Tu
16.09.16, 08:38
Hi,
ich versuche mit psycopg2 auf einen PostgreDB zuzugreifen, doch leider bekomme ich immer ein none zurueck und ich habe keine Idee was das bedeutet, bzw. was ich wieder falsch mache.
Passwort wird in der ~/.pgpass uebergeben.
python3
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>>
>>>
>>> PGHost = 'PGDBHost.loc'
>>>
>>> Statement = "select count(1) from goal.event_request where status = 'ACCEPTED'"
>>>
>>> pg_connect_string = 'host=%s user=myUser dbname=goal port=5432' % PGHost
>>> pg_connect = psycopg2.connect(pg_connect_string)
>>> cursor = pg_connect.cursor()
>>> ReturnValue = cursor.execute(Statement)
>>> print(ReturnValue)
None
>>> cursor.close()
ich versuche mit psycopg2 auf einen PostgreDB zuzugreifen, doch leider bekomme ich immer ein none zurueck und ich habe keine Idee was das bedeutet, bzw. was ich wieder falsch mache.
Passwort wird in der ~/.pgpass uebergeben.
python3
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>>
>>>
>>> PGHost = 'PGDBHost.loc'
>>>
>>> Statement = "select count(1) from goal.event_request where status = 'ACCEPTED'"
>>>
>>> pg_connect_string = 'host=%s user=myUser dbname=goal port=5432' % PGHost
>>> pg_connect = psycopg2.connect(pg_connect_string)
>>> cursor = pg_connect.cursor()
>>> ReturnValue = cursor.execute(Statement)
>>> print(ReturnValue)
None
>>> cursor.close()