2010/3/25 paulo matadr <saddon...@yahoo.com.br>

> Bom dia a Todos,
> Preciso que o psql guarde no log de execulcao todas as msg geradas,
> percebi o seguinte:
>
>
> postgres=# create database teste;
> CREATE DATABASE
> postgres=# \c teste;
> You are now connected to database "teste".
> teste=#  create table teste_psql( a int , b int);
> CREATE TABLE
> -bash-3.1$ cat  > teste.sql
> insert into teste_psql VALUES (1,1);                                ^
> insert into teste_psql VALUES (1,2);
> insert into teste_psql VALUES (1,3);
> insert into teste_psql VALUES (1,4);
> insert into teste_psql VALUES (1,5);
> insert into teste_psql VALUES (1,a);
>
>
> ---so  imprime  o error na tela----
> -bash-3.1$ psql -d teste -f teste.sql > resultado.log
> psql:teste.sql:2: ERROR:  syntax error at or near "^"
> LINE 1: ^
>         ^
> psql:teste.sql:6: ERROR:  column "a" does not exist
> LINE 1: insert into teste_psql VALUES (1,a);
>
> -bash-3.1$ cat resultado.log
> INSERT 0 1
> INSERT 0 1
> INSERT 0 1
> INSERT 0 1
> teste=# select * from  teste_psql;
>  a | b
> ---+---
>  1 | 1
>  1 | 3
>  1 | 4
>  1 | 5
> (4 rows)
> existe a possibidade de exporta pro log tanto sucesso quanto a falha?
>
>
psql postgres -f teste.sql > erros.txt 2>&1

>
> Ats
>
> Paulo
>
>
>
>
>
>
> ------------------------------
> Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 
> 10<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/>-
> Celebridades<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/celebridades/>-
> Música<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/m%C3%BAsica/>-
> Esportes<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/esportes/>
>
> _______________________________________________
> pgbr-geral mailing list
> pgbr-geral@listas.postgresql.org.br
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
>


-- 
JotaComm
http://jotacomm.wordpress.com
_______________________________________________
pgbr-geral mailing list
pgbr-geral@listas.postgresql.org.br
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a