Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CFFF1634904 for ; Wed, 5 Aug 2009 06:57:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 55828-02-2 for ; Wed, 5 Aug 2009 09:57:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.benders.se (mail.benders.se [212.247.52.15]) by mail.postgresql.org (Postfix) with ESMTP id 858C7635A7C for ; Wed, 5 Aug 2009 06:56:27 -0300 (ADT) Received: from comserver.benders.se (Not Verified[100.100.100.171]) by mail.benders.se with MailMarshal (v6, 1, 8, 2172) id ; Wed, 05 Aug 2009 11:56:36 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: Re: Problems when copy data from dump file Date: Wed, 5 Aug 2009 11:56:35 +0200 Message-ID: <2A250781A3744D48B1529FCC3C2EB8ABCB483B@comserver.benders.se> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: SV: [SQL] Problems when copy data from dump file thread-index: AcoVBz7DH2fUbh+kSTyJiHlzPA/ESAAp0lbA From: "Klas Stockhem" To: "Richard Huxton" Cc: "PostgreSQL" X-CT-RefID: str=0001.0A0B0204.4A795747.029F,ss=1,fgs=0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/17 X-Sequence-Number: 32926 -----Ursprungligt meddelande----- Fr=E5n: Richard Huxton [mailto:dev@archonet.com]=20 Skickat: den 4 augusti 2009 15:27 Till: Klas Stockhem Kopia: PostgreSQL =C4mne: Re: SV: [SQL] Problems when copy data from dump file Klas Stockhem wrote: > Thanks for your mail! Remember to cc: the mailing list too. Just hit "reply to all". Oh, and perhaps don't top-quote. It makes it difficult for others to=20 follow the message. > 1. Yes, the 5 and other text are at line 2 (a new line). I tried to = put > the whole command on the first line and execute it but I get same = error: >=20 >=20 > ERROR: syntax error at or near "1" > LINE 1: COPY artikkel (id, tittel, tekst) FROM stdin 1 test test; No, the data needs to start on the line below COPY, but your first email = had a blank line there. Your message had: Line 1: COPY artikkel (id, tittel, tekst) FROM stdin; Line 2: (blank) Line 3: 5 Slitasje og vedlikehold PRAKTISKE OPPLYSNINGER What you want is something like: COPY artikkel (id, tittel, tekst) FROM stdin; 1Title oneSome text 2Title twoSome text \. Where the marks are real tabs. > I have also separated the 1 and the "test-text" with tab. Is the = syntax > for the line 1 correct? I have read some about using DELIMITER. Do you > have a suggestion how a can use this in the command? >=20 > 2. Yes I have opened the dump file on in a windows system and = copy+paste > it into the phppgadmin web interface. Hmm - reading the phppgadmin documentation, the FAQ says the following: "Only uploaded SQL scripts can contain COPY commands and for this to=20 work, you must have PHP 4.2 or higher." So - it looks like you should save the COPY script to a text-file and=20 upload it. I don't know how you do that, but it should be in the manual. --=20 Richard Huxton Archonet Ltd > > > ok, I have downloaded and installed EMS SQL query 2007 local on my = computer and it works fine to connect to my database server from this = software. (It did'nt work with the phpPGadmin web interface.) I have also inserted data into my tables ansql query it works fine. I have just one problem left: I must type the schema name and table name = in all sql queries to get some outputs. E.g Schema2.table This makes some problems in my web applications. When I execute my php = files in the web browser the sql server returns "schema "public2" does = not exist". It reads the sql query in my web application like a small p = but I have typed big P in the php file. I can run this in the EMS = software and there it works fine. When I try to just type the table name in sql query like "SELECT * FROM = tablename" I get error "relation "tablename" does not exist". Does the php engine interpret the big P like a small one? Is it recommended to always have small letters in schema names? How do I make so I not must type the schema name in every sql query? The = best would be if I just can type the table name. //Klas