Search Postgresql Archives

Re: import sql dump with psql - language creation throws error

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

 



On Tuesday 20 January 2009 7:05:23 am Andreas Wenk wrote:

> Adrian,
>
> no lack of coffee but my fault. You are totally right - that was a copy and
> paste error. For sure the dump is *.sql.
>
> Until now there is no onboard solution for this issue. Means, the import of
> the dump is working correct but a "message" is thrown: FEHLER:  Sprache
> »plpgsql« existiert bereits (means ERROR: Language »plpgsql« allready
> exists). What I do now - and this is not really beautiful - is to erase
> that "message" before oputput is created from the shell script:
>
> psql -o /dev/null $DB < /var/lib/postgresql/scripts/$SQL_DUMP  2>&1 | grep
> -v "FEHLER: Sprache »plpgsql« existiert bereits"
> exit 0
>
> Now, no output from the script is catched by the crondaemon and no email is
> sent. On the other hand, no error from the above line is catched at all ...
> unfortunately ...
>
> By the way - language plpgsql was created with createlang plpgsql
> template1. And because of tsearch2 it's not possible to create the db from
> template0.
>
> Got another idea?
>
> Cheers
>
> Andy

 
Just to point you to Grzegorz's suggestion of using the  -c switch in the 
pg_dump command. To quote the manual:
 
-c    
"Output commands to clean (drop) database objects prior to (the commands for) 
creating them.

 This option is only meaningful for the plain-text format. For the archive 
formats, you can specify the option when you call pg_restore. "

Also I am not sure cron sending the email is a bad thing. Serves as indicator 
that the process ran.

-- 
Adrian Klaver
aklaver@xxxxxxxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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