How can i create a table in pgAdmin using python?

المشرف العام

Administrator
طاقم الإدارة
i am using below SQl query in python

cur.execute('''CREATE TABLE Ambhara_Survey (id SERIAL PRIMARY KEY, geom geometry, chalta_no TEXT, ror_area TEXT, ror_area_1 TEXT);''') conn.commit()

but its giving me error:

Traceback (most recent call last):

File "C:/Users/n/.qgis2/python/plugins\Importtool\Import_tool.py", line 225, in select_output_file_5 ror_area_1 TEXT);''')

ProgrammingError: type "geometry" does not exist

LINE 3: geom geometry,

i am try to resolve this error with the help of google and i got solution.

CREATE EXTENSION postgis;

In detail,

open pgAdmin

select (click) your database

click "SQL" icon on the bar

run "CREATE EXTENSION postgis;" code

it will give me another error :

ERROR: could not open extension control file "C:/Program Files/PostgreSQL/9.4/share/extension/postgis.control": No such file or directory

i have checked the path inside "C:/Program Files/PostgreSQL/9.4/share/extension/" but this(postgis.control) file can not be found there.



أكثر...
 
أعلى