pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedi have a big trouble
2+ messages / 2 participants
[nested] [flat]
* i have a big trouble
@ 2001-01-24 11:50 Sandis Jerics <sandis@mediaparks.lv>
2001-01-24 15:45 ` Re: i have a big trouble Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Sandis Jerics @ 2001-01-24 11:50 UTC (permalink / raw)
To: pgsql-sql
Hello list,
i expirienced that postgres seems doesn't want to eat it's own
dump... why? even freshly created!
whats wrong with me?
www_mod_lv=> \copy news from '/home/sites/www.mod.lv/web/news.sql'
\.
ERROR: copy: line 2, pg_atoi: error in "
At the international humanitarian mission of KFOR the Latvian unit participates with 10 soldiers from the National Armed Forces. The KFOR Latvian contingent - Military Police and medical units - will operate within the contingent of UK. "
: can't parse "
At the international humanitarian mission of KFOR the Latvian unit participates with 10 soldiers from the National Armed Forces. The KFOR Latvian contingent - Military Police and medical units - will operate within the contingent of UK. "
PQendcopy: resetting connection
i tried to do \copy from stdin, than throw in a one row of data, ended
with \., it doesnt work also.
This is my table:
CREATE TABLE news(
id SERIAL PRIMARY KEY,
flag CHAR(1) NOT NULL,
rubrika CHAR(1) NOT NULL,
datums_ TIMESTAMP NOT NULL,
datums VARCHAR(30) NOT NULL,
virsraksts VARCHAR(200) NOT NULL,
teksts TEXT,
url VARCHAR(30),
url_txt VARCHAR(50)
);
an example row of data (tab separated) attached.
anyone may have an idea?
--
Sandis
7777609
9237502
Attachments:
row.txt (text/plain, 2.4K) download
45 a 2 2000-03-24 17:09:52+02 24.03.2000 ON THE RESULTS OF THE VISIT IN BRUSSELS Today on the 24th of March, the Minister of Defence, Mr. Ìirts Valdis Kristovskis, and Minister of Foreign Affairs, Mr. Indulis Bçrziòð, participated at the meeting of the North Atlantic Council and Latvia, led by the NATO Secretary General, Lord George Robertson. The Latvian representatives presented the Progress report on what has been accomplished and achieved in implementation of the Membership Action Plan (MAP) of Latvia for 2000.
\
The Minister of Defence, Mr.Ìirts Valdis Kristovskis, in his speech informed ambassadors of the NATO member-countries, on what has been accomplished in the defence system of Latvia within MAP. Mr. Ì.V.Kristovskis noted, that Latvia's activity and full determination to participate in the process, is aimed at preparing Latvia to be ready to accept the invitation to join the North Atlantic Treaty Organisation at the next round of enlargement. At the same time Minister of Defence emphasised, that a lot still has to be done in improvement of the systems of procurement and military education.
\
During the meeting it was noted that Latvia is one of the best NATO candidate - states as concerns the execution of the Membership Action Plan. It was also concluded at the session, that Membership Action Plan of Latvia for 2000 is well prepared, realistic, and financially well founded. The ambassadors of NATO member countries, acknowledged that Latvia has a systemic and purposeful approach in solving state defence related issues.
\
Ambassadors of the NATO members states also positively evaluated Latvia's readiness to contribute to European security, more precisely - to participate by providing officers of the Latvian National Armed Forces for peace-keeping and peace - support missions in Bosnia - Hercegovina and Kosovo, as well as noting the close co-operation among the Baltic States themselves.
\
Participants at the session also discussed the need for Latvia to enlarge her defence budget to 2% of the GDP, which is the average level of NATO countries. To this the Latvian representatives responded that the Government of Latvia has expressed the political will increasing state defence expenditures. Today at the session in Brussels, both the Minister of Defence, Ì.V.Kristovskis, and Minister of Foreign Affairs, once more stressed Latvia's strong determination to continue the initiated process of preparation for joining NATO.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: i have a big trouble
2001-01-24 11:50 i have a big trouble Sandis Jerics <sandis@mediaparks.lv>
@ 2001-01-24 15:45 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2001-01-24 15:45 UTC (permalink / raw)
To: Sandis Jerics <sandis@mediaparks.lv>; +Cc: pgsql-sql
Sandis Jerics <sandis@mediaparks.lv> writes:
> www_mod_lv=> \copy news from '/home/sites/www.mod.lv/web/news.sql'
> \.
> ERROR: copy: line 2, pg_atoi: error in "
> At the international humanitarian mission of KFOR the Latvian unit participates with 10 soldiers from the National Armed Forces. The KFOR Latvian contingent - Military Police and medical units - will operate within the contingent of UK. "
Notice that the complaint is from pg_atoi, so the problem is that the
given text is being taken as an integer field --- that is, as the start
of a new row of data. I suspect what is happening is that the embedded
newlines in your text column are getting munged up so that they look
like ordinary newlines (end of a data row) to COPY.
A newline that is part of the data, and not a row separator, has to be
represented as a backslash followed by a newline (\n) character.
Anything that messes this up will confuse COPY. One theory that comes
to mind is that you edited the dump file with an editor that converts
Unix-style newlines (\n) to DOS-style (\r\n). Then your embedded
newlines would become backslash \r \n ... in other words, a quoted \r
followed by a regular end-of-row marker.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-01-24 15:45 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-24 11:50 i have a big trouble Sandis Jerics <sandis@mediaparks.lv>
2001-01-24 15:45 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox