Search Postgresql Archives

Re: How to import *.sql file to postgresql database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the reply,

I have this error:

[quote]
ERROR:  invalid byte sequence for encoding "UTF8": 0xff
HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
[/quote]

I have set the client encoding to LATIN1 like this,

[quote]
$psql <database>
database=> set client_encoding to "LATIN1";
SET
database=>\i /home/folder1/data.sql
[/quote]

Then I got this different error:

[quote]
psql:/home/folder1/data.sql:1: ERROR:  syntax error at or near "ÿþ"
LINE 1: ÿþ-
        ^
[/quote]

How should I solve this problem?


Best Regards,


On Sun, Jul 18, 2010 at 9:10 PM, Szymon Guz <mabewlun@xxxxxxxxx> wrote:


2010/7/18 Andre Lopes <lopes80andre@xxxxxxxxx>

Hi,

I have a DUMP file with INSERT's commands. I need to import this data to postgresql database with the "psql" command.

How can I do this task?

Best Regards,

Hi,
you can do that for example using the following command:

psql <database> < file.sql

where <datatabase> is the name of the database you use.

regards
Szymon Guz


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux