From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Fabrízio Mello <fabriziomello(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: psql: show only failed queries |
Date: | 2014-03-04 07:52:37 |
Message-ID: | CAFj8pRBBzhz2i0wE-2fW59f19yCtuww_oFQbKaG2oDoUT-CZnw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
2014-03-04 6:35 GMT+01:00 Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>:
>
>
>
> On Sat, Mar 1, 2014 at 8:01 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> >
> > Hello
> >
> > I was asked, how can be showed only failed queries in psql.
> >
> > I am thinking, so it is not possible now. But implementation is very
> simple
> >
> > What do you think about it?
> >
> > bash-4.1$ psql postgres -v ECHO=error -f data.sql
> > INSERT 0 1
> > Time: 27.735 ms
> > INSERT 0 1
> > Time: 8.303 ms
> > psql:data.sql:3: ERROR: value too long for type character varying(2)
> > insert into foo values('bbb');
> > Time: 0.178 ms
> > INSERT 0 1
> > Time: 8.285 ms
> > psql:data.sql:5: ERROR: value too long for type character varying(2)
> > insert into foo values('ssssss');
> > Time: 0.422 ms
> >
>
> The patch works fine, but I think we must add some prefix to printed
> query. Like that:
>
> fabrizio=# \set ECHO error
> fabrizio=# insert into foo values ('XXX');
>
> ERROR: value too long for type character varying(2)
> DETAIL: insert into foo values ('XXX');
>
> or
>
> fabrizio=# \set ECHO error
> fabrizio=# insert into foo values ('XXX');
>
> ERROR: value too long for type character varying(2)
> QUERY: insert into foo values ('XXX');
>
> This may help to filter the output with some tool like 'grep'.
>
sure, good idea.
I add link to your notice to commitfest app
Regards
Pavel
>
> Regards,
>
> --
> Fabrízio de Royes Mello
> Consultoria/Coaching PostgreSQL
> >> Timbira: http://www.timbira.com.br
> >> Blog sobre TI: http://fabriziomello.blogspot.com
> >> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
> >> Twitter: http://twitter.com/fabriziomello
>
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2014-03-04 07:55:35 | Re: patch: option --if-exists for pg_dump |
Previous Message | Kyotaro HORIGUCHI | 2014-03-04 07:08:02 | Re: UNION ALL on partitioned tables won't use indices. |