LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-08-2004, 02:54 AM   #1
vickr1z
Member
 
Registered: Mar 2004
Location: manila, philippines
Distribution: RH 7.3
Posts: 63

Rep: Reputation: 15
postgres COPY function needed help


im having this error on my script:
psqlolmap.sql:18: invalid command \.
psqlolmap.sql:36: invalid command \.

polmap.sql
Code:
\c polmap
BEGIN;

SET search_path = public, pg_catalog;

--
-- Data for TOC entry 315 (OID 761231)
-- Name: provinces; Type: TABLE DATA; Schema: public; Owner: dbadmin
--

COPY provinces (province_name, province_code, db_user, "timestamp") FROM stdin;
APAYAO	988100000	dbadmin	2004-01-27 06:48:19.458466
MOUNTAIN PROVINCE	984400000	dbadmin	2004-01-27 06:48:19.458466
KALINGA	983200000	dbadmin	2004-01-27 06:48:19.458466
IFUGAO	982700000	dbadmin	2004-01-27 06:48:19.458466
\.

--
-- Data for TOC entry 316 (OID 761238)
-- Name: municipalities; Type: TABLE DATA; Schema: public; Owner: dbadmin
--

COPY municipalities (municipality_name, municipality_code, db_user, "timestamp") FROM stdin;
SAN MIGUEL	993907000	dbadmin	2004-01-27 06:48:19.464152
MALATE	993910000	dbadmin	2004-01-27 06:48:19.464152
CITY OF LAS PIÑAS	997601000	dbadmin	2004-01-27 06:48:19.464152
CITY OF PARAÑAQUE	997604000	dbadmin	2004-01-27 06:48:19.464152
PASAY CITY	997605000	dbadmin	2004-01-27 06:48:19.464152
SAN NICOLAS	993904000	dbadmin	2004-01-27 06:48:19.464152
NAVOTAS	997503000	dbadmin	2004-01-27 06:48:19.464152
TONDO	993901000	dbadmin	2004-01-27 06:48:19.464152
\.
what does the errors mean: do i have to edit my script?? i just got this created from a database dump (pg_dump -h 192.12.0.100 polmapdb > polmap.sql)

how can i fix my script so it would run correctly?? any idea will appreciate very much..
 
Old 11-08-2004, 06:36 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
You didn't say how you are using the script.

The problem is this:
Code:
\.
which is being used to mean “end of file” in the dump script. If you don't use the right utility (I think you want psql) to load the script, it won't know what to do with \. because it's not a part of SQL.

Copying from Postgres to postgres, you might find it easier to use a binary dump file (see the pg_dump manpage); it's faster than using an SQL dump and takes up less space.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
not calling copy constructor on function return jhorvath Programming 7 09-22-2009 01:43 PM
c++ copy() function greg108 Programming 3 08-11-2005 12:13 PM
php postgres connecting needed help vickr1z Linux - Newbie 2 11-11-2004 04:13 AM
postgres dump needed help. vickr1z Linux - Newbie 3 11-10-2004 04:22 AM
nvidia tv-out Xorg.conf copy needed... TomCollins Slackware 4 11-07-2004 03:50 PM


All times are GMT -5. The time now is 08:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration