Обсуждение: Import from Linux to Windows

Поиск
Список
Период
Сортировка

Import from Linux to Windows

От
"Tom Haddon"
Дата:
Hi,

I have a dump file created using pg_dumpall on Linux that I'm trying to
import into Windows. I know this dump file is good as I've tested it and
looked at it. When I run it against the Windows version (8.0.0beta1)
from within psql with the \i switch, it loads in the structure of the
first database in the dump, and creates all the databases and users, but
doesn't populate the data of the first database, and doesn't create the
structure of all the other databases.

My guess is this is a Windows formatting issue. Do I just need to do a
search and replace on \n or \t and replace it with something?

Thanks, Tom

Re: Import from Linux to Windows

От
Andrew Dunstan
Дата:

Tom Haddon wrote:

>Hi,
>
>I have a dump file created using pg_dumpall on Linux that I'm trying to
>import into Windows. I know this dump file is good as I've tested it and
>looked at it. When I run it against the Windows version (8.0.0beta1)
>from within psql with the \i switch, it loads in the structure of the
>first database in the dump, and creates all the databases and users, but
>doesn't populate the data of the first database, and doesn't create the
>structure of all the other databases.
>
>My guess is this is a Windows formatting issue. Do I just need to do a
>search and replace on \n or \t and replace it with something?
>
>
>
>

What is the error? You don't by any chance have a ^Z somewhere in the
file, do you?

cheers

andrew

Re: Import from Linux to Windows

От
"Tom Haddon"
Дата:
I don't think so. Did a search for it in vi and nothing. It doesn't give
me an error, just exits. Last statement is "CREATE TABLE".

Sorry, not very helpful...

Thanks, Tom

-----Original Message-----
From: Andrew Dunstan [mailto:andrew@dunslane.net]
Sent: Wednesday, August 11, 2004 1:44 PM
To: Tom Haddon
Cc: pgsql-hackers-win32@postgresql.org
Subject: Re: [pgsql-hackers-win32] Import from Linux to Windows




Tom Haddon wrote:

>Hi,
>
>I have a dump file created using pg_dumpall on Linux that I'm trying to

>import into Windows. I know this dump file is good as I've tested it
>and looked at it. When I run it against the Windows version
>(8.0.0beta1) from within psql with the \i switch, it loads in the
>structure of the first database in the dump, and creates all the
>databases and users, but doesn't populate the data of the first
>database, and doesn't create the structure of all the other databases.
>
>My guess is this is a Windows formatting issue. Do I just need to do a
>search and replace on \n or \t and replace it with something?
>
>
>
>

What is the error? You don't by any chance have a ^Z somewhere in the
file, do you?

cheers

andrew

Re: Import from Linux to Windows

От
Claudio Natoli
Дата:
Hi there,

have a vague recollection of a sysadmin here coming to me with a similar
issue. Suggested he try unix2dos and retry the import.

Don't know if it is a generic fix, but it got him through.

Cheers,
Claudio


-----Original Message-----
From: Tom Haddon
To: pgsql-hackers-win32@postgresql.org
Sent: 8/12/04 5:09 AM
Subject: [pgsql-hackers-win32] Import from Linux to Windows

Hi,

I have a dump file created using pg_dumpall on Linux that I'm trying to
import into Windows. I know this dump file is good as I've tested it and
looked at it. When I run it against the Windows version (8.0.0beta1)
from within psql with the \i switch, it loads in the structure of the
first database in the dump, and creates all the databases and users, but
doesn't populate the data of the first database, and doesn't create the
structure of all the other databases.

My guess is this is a Windows formatting issue. Do I just need to do a
search and replace on \n or \t and replace it with something?

Thanks, Tom

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>

Re: Import from Linux to Windows

От
Bruce Momjian
Дата:
Claudio Natoli wrote:
>
> Hi there,
>
> have a vague recollection of a sysadmin here coming to me with a similar
> issue. Suggested he try unix2dos and retry the import.
>
> Don't know if it is a generic fix, but it got him through.

That is not required in 7.4 and later releases.

---------------------------------------------------------------------------


>
> Cheers,
> Claudio
>
>
> -----Original Message-----
> From: Tom Haddon
> To: pgsql-hackers-win32@postgresql.org
> Sent: 8/12/04 5:09 AM
> Subject: [pgsql-hackers-win32] Import from Linux to Windows
>
> Hi,
>
> I have a dump file created using pg_dumpall on Linux that I'm trying to
> import into Windows. I know this dump file is good as I've tested it and
> looked at it. When I run it against the Windows version (8.0.0beta1)
> from within psql with the \i switch, it loads in the structure of the
> first database in the dump, and creates all the databases and users, but
> doesn't populate the data of the first database, and doesn't create the
> structure of all the other databases.
>
> My guess is this is a Windows formatting issue. Do I just need to do a
> search and replace on \n or \t and replace it with something?
>
> Thanks, Tom
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>
> ---
> Certain disclaimers and policies apply to all email sent from Memetrics.
> For the full text of these disclaimers and policies see
> <a
> href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
> ailpolicy.html</a>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Import from Linux to Windows

От
Andrew Dunstan
Дата:

Tom Haddon wrote:

>I don't think so. Did a search for it in vi and nothing. It doesn't give
>me an error, just exits. Last statement is "CREATE TABLE".
>
>Sorry, not very helpful...
>
>
>
>
>

I think you'll need to let us look at the dump file to make any progress
- otherwise we are just guessing in the dark.

thanks

andrew

Re: Import from Linux to Windows

От
Andrew Dunstan
Дата:
I tested the file on Linux and saw the same result. When I converted it
with dos2unix it worked properly - it certainly looks like we have a
line-ending issue somewhere - I will investigate.

(I guess the "good" news is that it doesn't look like a Windows problem ...)

cheers

andrew

Tom Haddon wrote:

>Here's what I can share, as there's some sensitive stuff in others.
>
>This is just a dump from one of the databases. I was able to load it
>using the \i switch, but it has only populated data from the first
>table. Also, it kept prompting me to hit a key as the screen was
>scrolling. This doesn't seem normal to me. And I tried running it as a
>SQL statement from within PgAdmin3, and got:
>
>"ERROR:  syntax error at or near "1" at character 15030"
>
>The first "1" you see is where this error is.
>
>COPY backup_data (id, lu, ub, tape, contents, last_writter,
>times_written) FROM stdin;
>1    2004-07-13 09:37:14.78254    thaddon    DLT000005    Full
>Backup (including only 2004 filings) 6/9/04\r\n\r\nNow archived
>2004-06-09    6
>4    2004-07-13 09:40:57.876355    thaddon    DLT000009    Full
>Backup 7/12/04    2004-07-12    4
>3    2004-07-21 16:28:09.843069    thaddon    DLT000007    Full
>Backup 7/21/04\r\n\r\nC:\\Perforce\\*.* /SUBDIR \r\nD:\\backup\\*.*
>/SUBDIR \r\nDMTNJ1-SERVER\\insight_backup\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\equilar_ca\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\dmt_media\\public\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\dmt_media\\public\\software\\*.* /SUBDIR /EXCLUDE
>\r\nHOTNSOUR\\sql_backup\\*.* /SUBDIR
>\r\nYODA\\sec_filings\\filings\\2004\\06\\*.* /SUBDIR
>\r\nYODA\\sec_filings\\filings\\2004\\07\\*.* /SUBDIR \r\nYODA\\qa\\*.*
>/SUBDIR \r\nMILLENIUM\\ExchangeBackup\\*.* /SUBDIR \r\n    2004-07-21
>14
>2    2004-07-22 13:27:01.657706    thaddon    DLT000006    Full
>Backup 7/22/04\r\n\r\nC:\\Perforce\\*.* /SUBDIR \r\nD:\\backup\\*.*
>/SUBDIR \r\nDMTNJ1-SERVER\\insight_backup\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\equilar_ca\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\dmt_media\\public\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\dmt_media\\public\\software\\*.* /SUBDIR /EXCLUDE
>\r\nHOTNSOUR\\sql_backup\\*.* /SUBDIR
>\r\nYODA\\sec_filings\\filings\\2004\\06\\*.* /SUBDIR
>\r\nYODA\\sec_filings\\filings\\2004\\07\\*.* /SUBDIR \r\nYODA\\qa\\*.*
>/SUBDIR \r\nMILLENIUM\\ExchangeBackup\\*.* /SUBDIR \r\n    2004-07-22
>10
>5    2004-07-27 10:49:22.786997    thaddon    DLT000008
>Incremental backup since last full 7/21/04 last updated
>7/23/04\r\n\r\nWill include (as of 7/23/04):\r\n\r\nC:\\Perforce\\*.*
>/SUBDIR \r\nD:\\backup\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\insight_backup\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\equilar_ca\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\dmt_media\\public\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\dmt_media\\public\\software\\*.* /SUBDIR /EXCLUDE
>\r\nHOTNSOUR\\sql_backup\\*.* /SUBDIR \r\nYODA\\qa\\*.* /SUBDIR
>\r\nYODA\\sec_filings\\filings\\2004\\06\\*.* /SUBDIR
>\r\nYODA\\sec_filings\\filings\\2004\\07\\*.* /SUBDIR
>\r\nMILLENIUM\\ExchangeBackup\\*.* /SUBDIR \r\n    2004-07-23    3
>6    2004-07-27 10:50:11.802647    thaddon    DLT000010
>Differential backup since 7/21/04\r\n\r\nC:\\Perforce\\*.* /SUBDIR
>\r\nD:\\backup\\*.* /SUBDIR \r\nDMTNJ1-SERVER\\insight_backup\\*.*
>/SUBDIR \r\nDMTNJ1-SERVER\\equilar_ca\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\dmt_media\\public\\*.* /SUBDIR
>\r\nDMTNJ1-SERVER\\dmt_media\\public\\software\\*.* /SUBDIR /EXCLUDE
>\r\nHOTNSOUR\\sql_backup\\*.* /SUBDIR \r\nYODA\\qa\\*.* /SUBDIR
>\r\nYODA\\sec_filings\\filings\\2004\\06\\*.* /SUBDIR
>\r\nYODA\\sec_filings\\filings\\2004\\07\\*.* /SUBDIR
>\r\nMILLENIUM\\ExchangeBackup\\*.* /SUBDIR \r\n    2004-07-27    1
>\.
>
>Thanks, Tom
>
>-----Original Message-----
>From: Andrew Dunstan [mailto:andrew@dunslane.net]
>Sent: Thursday, August 12, 2004 8:40 AM
>To: Tom Haddon
>Cc: pgsql-hackers-win32@postgresql.org
>Subject: Re: [pgsql-hackers-win32] Import from Linux to Windows
>
>
>
>
>Tom Haddon wrote:
>
>
>
>>I don't think so. Did a search for it in vi and nothing. It doesn't
>>give me an error, just exits. Last statement is "CREATE TABLE".
>>
>>Sorry, not very helpful...
>>
>>
>>
>>
>>
>>
>>
>
>I think you'll need to let us look at the dump file to make any progress
>
>- otherwise we are just guessing in the dark.
>
>thanks
>
>andrew
>
>