Postgresql database import and export, postgresql Import and ExportExport a remote database
1. Export the threshold table structure and data to the file threshold. SQL from the database monitor on the remote database IP Address:
pg_dump -t threshold -h 135.32.94.142 monitor -U monitor -p 5432 -f threshold.sql
-T spec
The last time I talked about. net create XML file (a fixed way, a dynamic method), this time record how to import XML file1. How to import XML files1) XML file format2) Style of form page3) Source code Example3.1) Create the sourc
New Feature of PostgreSQL 9.5: IMPORT FOREIGN SCHEMA
This story tells the story of an employee who does not keep up with the pace of the times and does not actively learn the latest features, how to Lose the advantages of "old employees" and the trust of leaders.
On a morning without smog, the technical department leader called James to the office and asked, "Brother, I want to query the data of the produc
Tags: Create space name failed OCA nbsp SRC GRE Computer environment Importing SHP files into PostgreSQL 1, first, you need to make Shp2pgsql command available, Baidu Download, add environment variables can. : https://download.osgeo.org/postgis/windows/pg96/ , open the URL, download the target file, extract the following directory: Add the directory to the environment variable, and then cmd to run Shp2pgsql. 2. The command is as follows: S
To back up the database:pg_dump-h localhost-u root demo02 >/home/arno/dumps/demo02.bakTo recover a database:psql-h localhost-u root-d Demo Backup table:pg_dump-h localhost-u root demo02-t books >/home/arno/dumps/books.bakRecovery table:psql-h localhost-u root-d demo-t Books Psql Copy to/from usage:1. Need to log in to the database using Postgres Super User psql-u postgres-d demo022. Saved/Read folders need to give Postgres user permission to read and write3. Exporting data to a file in a tableco
Tags: database chinese pgsql PostgreSQL tableAt that time encountered this problem, a variety of Baidu also found no solution. Now that we've solved it, let's share the method:
Table format must be CSV format 650) this.width=650; "title=" Eeeee.png "src=" http://s3.51cto.com/wyfs02/M01/75/16/wKiom1Yx_ Uct35n7aab8cccmavq446.jpg "alt=" Wkiom1yx_uct35n7aab8cccmavq446.jpg "/>
Open the file with Notepad, then click "Encode" in File > Save as >
Export table
Pg_dump-h localhost-u postgres (user name) database name (with user name by default)-T table (table name) > Dump.sql
Import Table
Psql-f Dump.sql
Example of a complete import export table
1, check the original database
-bash-3.2$ psql-u playboy-d Playboy//Original databaseWelcome to Psql 8.1.23, the PostgreSQL Interactive terminal.Type: \copyri
PostgreSQL 9.5 new features: IMPORT FOREIGN SCHEMA
This time in the form of a story about a person who does not follow the pace of the times, not active learning staff in the case of not understanding the latest features, how to lose the "old staff" advantage and leadership of the trust.
In a sunny, no haze in the morning, the technical department leader to call Xiao Ming to the office, asked: "Brother, I
Command operation: data export: pg_dump-Upostgres (User Name) (-t table name) Database Name (lack of time and the same user name) c: fulldb. SQL data import: psql-Upostgres (User Name) Database Name (lack of time and the same user name) C: fulldb. sqlpgAdmin operation: export data: Right-click the database name -- backup -- OK to save data
Command operation: export data: pg_dump-U postgres (User Name) (-t table name) Database Name (lack of time and th
The various load file modes and time of MySQL and PostgreSQL were evaluated on the virtual machine. Because it is a test on the virtual machine, so time only to do the reference, not too serious, look good.MySQL Tools:1. Bring your own Mysqlimport tool.2. Command line load Data infile ...3. Use Mysql-connector-python driver to write the script.PostgreSQL Tools:1. Pgloader third-party tools.2. Command line copy ... from ...3. Use the Python script writ
Tags:host use methods localhostexp Import post table name bsp
Import the entire databasePsql-u postgres (user name) database name (default is the same as user name)
Export the entire databasePg_dump-h localhost-u postgres (user name) database name (default is the same as user name) >/data/dum.sql
Export a tablePg_dump-h localhost-u postgres (user name) database name (default is the same
You can use the mdbtools tool to export each table contained in an mdb file to a csv file. The format of the access database and postgresQL database may be different. Therefore, you can use python File Processing to modify the csv file to a correct and recognizable format.
Description of the import script (this script runs on linux ):
1. apt-get install mdbtools and install mdbtools
2. Copy the mdb file to
Label:Collated the way PostgreSQL imports and exports related schemas.First, export:Export the schema table structure and data of CRM in his library (-n parameter):p g_dump-h 192.168.2.154 -P 5432-d his-n crm-f Test.sql Only export the schema table structure of CRM in his library (-s parameter) :p g_dump-h 192.168.2.154- p 5432-d his-n crm-s-F Test2.sqlsecond, the introduction of different schemas Third, otherPostgreSQL can not specify a new schema
Tags: PostgreSQL csv import1.excel file ProcessingDelete header row, save as comma delimiter csv file2. file format processing Notepad + +1). convert Files to UNIX format2). format conversion to UTF8 no BOM3. Uploading to the database importPrecautions:1). Character set configuration, operating system character set Lang=en_us. UTF-8Database Character Set UTF-8uccc_im=# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access Privileges
Import commandpsql-d game-u postgres-f/root/plubic.sqlThe following error occurred:Psql:FATAL:Peer authentication failed for user "Postgres" The workaround for this subcommandRun the following command to edit the pg_hba.conf file because pg_hba.conf cannot be foundFind/-name pg_hba.confVi/var/lib/pgsql/9.5/data/pg_hba.conf2. The# Database Administrative Login by Unix domain socketlocal all postgres peerSwit
The R language provides an XML package for parsing XML data formats, including importing XML data and processing XML data. examples are as follows.
What is XML?
• XML refers to the EXtensible Markup Language)•
Label:Export Import of PostgreSQL dataTo export data from a PostgreSQL database: $ pg_dump-u postgres-f mydatabase.sql mydatabase When importing data, first create the database and then import it with Psql: $ createdb Newdatabase$ psql-d newdatabase-u postgres-f Mydatabase.sql Create a database CREATE DATABASE Test
has not paid attention to this function, yesterday looked at a bit, the database inserted bottlenecks, today studied a bit:The main scenarios are as follows:1. import from a file using copy :Copy table_001 (A, B, "F", D, C, "E") from ' D:/data1.txt ' (delimiter ', ');Extremely fast speed:Without index:Query succeeded: A total of 69971 rows were affected, time consuming: 4351 milliseconds (ms). Query succeeded: A total of 69971 rows were affected, tim
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.