Postsql | Debug record

Source: Internet
Author: User
Tags postgresql postgis

1-csv Importing PostgreSQL • Description of the problem:You need to import the CSV to the local database, but columns a lot, do not want to create a new table, and set each field name, type, and copy from • Solutions:The Python pandas package makes it easy to import names and data from CSV into a database
 from Import Create_engine Import  = create_engine ('postgresql://user:[email protected]/db_name'= Pd.read_csv ('/path/to/csv_file') df.to_sql ('pandas_db  ', engine
You can also add the if_exists parameter, which is used to replace or add to the existing data table, e.g.

Df.to_sql ('pandas_db', engine, if_exists='replace')
This also applies to adding documents.

For related documents see: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_sql.html 2-postgresql Connection PostGIS for space operation • Questions:Convert column to type, error

ERROR:  "geometry" not exist
The reason is that the PostGIS module is missing • Solutions:-Open Pgadmin-Select Working Database-click on SQL Add Command-execute "CREATE EXTENSION PostGIS;"

Continuous update ...

Postsql | Debug record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.