Обсуждение: Use of INNER JOIN and others ??!?
Is it possible to use the statements INNER JOIN, OUTER JOIN, LEFT JOIN and RIGHT JOIN in the new version of PostgreSQL 7.1 ? Luis Sousa
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 ArmedForces. 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 ArmedForces. 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
Вложения
> Is it possible to use the statements INNER JOIN, OUTER JOIN, LEFT JOIN > and RIGHT JOIN in the new version of PostgreSQL 7.1 ? Yes in 7.1beta. See FAQ 'outer' entry for a short description. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026
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 ArmedForces. 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