导入转储时发生postgresql错误
我从客户端获得了sql转储,这是从postgresql生成的sql转储脚本的一个端口导入转储时发生postgresql错误,postgresql,enterprisedb,Postgresql,Enterprisedb,我从客户端获得了sql转储,这是从postgresql生成的sql转储脚本的一个端口 -- -- EnterpriseDB database dump -- -- Dumped from database version 10.1.5 -- Dumped by pg_dump version 10.1.5 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0;
--
-- EnterpriseDB database dump
--
-- Dumped from database version 10.1.5
-- Dumped by pg_dump version 10.1.5
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET edb_redwood_date = off;
SET default_with_rowids = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
.
. Till Then so long here
.
COPY inittemp (terminalid, tracenumber, createat, data, flag) FROM stdin;
\.
--
-- Data for Name: tbaid; Type: TABLE DATA; Schema: public; Owner: tmsedc
--
COPY tbaid (aidid, appvernum, aidname, tacdefault, tacdenial, taconline, threshold, target, maxtarget, defaultddol, defaulttdol, bankacqid, floorlimit, categorycode, trxtype, terminalcapability, indicatortag, databaseid, status, isapproved, approveddate, approvedby, cardtype) FROM stdin;
asd s s s 0 0 0.0.0.0 0 0 750 s s s s s s s 1 Y Y 2018-06-29 10:20:23.174239 ayao s
2222 s 222 s 0 0 0.0.0.0 0 0 750 s s s s s s s 1 Y Y 2018-06-29 11:25:39.504868 ayao s
11 11 11 0 0 0 0.0.0.0 0 0 750 1 1 1 1 1 1 1 1 N Y 2018-06-29 10:21:05.103313 ayao 1
0001 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 Y Y \N \N xxxxx
\.
这是我的第一个错误:
ERROR: syntax error at or near "\"
LINE 5301: \.
^
SQL state: 42601
Character: 243732
我删除了\。
,并得到另一个错误:
ERROR: syntax error at or near "asd"
LINE 5309: asd s s s 0 0 0.0.0.0 0 0 750 s s s s s s s 1 Y Y 2018-06-29...
^
SQL state: 42601
Character: 244104
我对osx使用了postgresql 10.4,并使用execute query导入此转储
请帮我解决这个问题
哦,是的,还有一个问题,enterpriseDB和postgresql是否相同?您不能使用“执行查询”导入转储。您需要使用命令行工具psql来运行该脚本,例如,
psql-U postgres-f dump_file.sql
好的,让我试试