pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Capturing pgsql ERRORS/NOTICES to file
5+ messages / 3 participants
[nested] [flat]

* Capturing pgsql ERRORS/NOTICES to file
@ 2003-09-26 18:00  George Weaver <georgew1@mts.net>
  0 siblings, 1 reply; 5+ messages in thread

From: George Weaver @ 2003-09-26 18:00 UTC (permalink / raw)
  To: pgsql-sql

I am in the process of creating a batch file that will update some functions in a database for a remote user similar to:

psql -o output dbname < functionupdate.sql

Is there any way to save any ERROR and NOTICE messages to a file?  

The -o option doesn't capture this information.

Thanks,
George

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Capturing pgsql ERRORS/NOTICES to file
@ 2003-09-26 18:33  Josh Berkus <josh@agliodbs.com>
  parent: George Weaver <georgew1@mts.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Josh Berkus @ 2003-09-26 18:33 UTC (permalink / raw)
  To: George Weaver <georgew1@mts.net>; pgsql-sql

George,

> I am in the process of creating a batch file that will update some
> functions in a database for a remote user similar to:
>
> psql -o output dbname < functionupdate.sql
>
> Is there any way to save any ERROR and NOTICE messages to a file?
>
> The -o option doesn't capture this information.

You have to use command shell redirects.

For example, I commonly do in bash
psql -o output dbname < functionupdate.sql >out.dump
... which sends all the command responses to a file, allowing me to read only 
the errors on the screen.

See a guide to your shell for more creative redirection.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Capturing pgsql ERRORS/NOTICES to file
@ 2003-09-26 19:15  George Weaver <georgew1@mts.net>
  parent: Josh Berkus <josh@agliodbs.com>
  0 siblings, 1 reply; 5+ messages in thread

From: George Weaver @ 2003-09-26 19:15 UTC (permalink / raw)
  To: Josh Berkus <josh@agliodbs.com>; pgsql-sql

Hi Josh,

Thanks for the reply.

What I am trying to achieve is to have errors go to a file, rather than show
up on the screen.

Is this possible?

George

----- Original Message ----- 
From: "Josh Berkus" <josh@agliodbs.com>
To: "George Weaver" <georgew1@mts.net>; <pgsql-sql@postgresql.org>
Sent: Friday, September 26, 2003 1:33 PM
Subject: Re: [SQL] Capturing pgsql ERRORS/NOTICES to file


> George,
>
> > I am in the process of creating a batch file that will update some
> > functions in a database for a remote user similar to:
> >
> > psql -o output dbname < functionupdate.sql
> >
> > Is there any way to save any ERROR and NOTICE messages to a file?
> >
> > The -o option doesn't capture this information.
>
> You have to use command shell redirects.
>
> For example, I commonly do in bash
> psql -o output dbname < functionupdate.sql >out.dump
> ... which sends all the command responses to a file, allowing me to read
only
> the errors on the screen.
>
> See a guide to your shell for more creative redirection.
>
> -- 
> Josh Berkus
> Aglio Database Solutions
> San Francisco
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Capturing pgsql ERRORS/NOTICES to file
@ 2003-09-26 19:16  Wei Weng <wweng@kencast.com>
  parent: George Weaver <georgew1@mts.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Wei Weng @ 2003-09-26 19:16 UTC (permalink / raw)
  To: George Weaver <georgew1@mts.net>; +Cc: pgsql-sql

George:

Have you tried psql {whatever operations} 2> error_output ?

(for Bash)

Thanks

Wei


On Fri, 26 Sep 2003, George Weaver wrote:

> Hi Josh,
> 
> Thanks for the reply.
> 
> What I am trying to achieve is to have errors go to a file, rather than show
> up on the screen.
> 
> Is this possible?
> 
> George
> 
> ----- Original Message ----- 
> From: "Josh Berkus" <josh@agliodbs.com>
> To: "George Weaver" <georgew1@mts.net>; <pgsql-sql@postgresql.org>
> Sent: Friday, September 26, 2003 1:33 PM
> Subject: Re: [SQL] Capturing pgsql ERRORS/NOTICES to file
> 
> 
> > George,
> >
> > > I am in the process of creating a batch file that will update some
> > > functions in a database for a remote user similar to:
> > >
> > > psql -o output dbname < functionupdate.sql
> > >
> > > Is there any way to save any ERROR and NOTICE messages to a file?
> > >
> > > The -o option doesn't capture this information.
> >
> > You have to use command shell redirects.
> >
> > For example, I commonly do in bash
> > psql -o output dbname < functionupdate.sql >out.dump
> > ... which sends all the command responses to a file, allowing me to read
> only
> > the errors on the screen.
> >
> > See a guide to your shell for more creative redirection.
> >
> > -- 
> > Josh Berkus
> > Aglio Database Solutions
> > San Francisco
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> >
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
> 



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Capturing pgsql ERRORS/NOTICES to file
@ 2003-09-26 19:46  George Weaver <georgew1@mts.net>
  parent: Wei Weng <wweng@kencast.com>
  0 siblings, 0 replies; 5+ messages in thread

From: George Weaver @ 2003-09-26 19:46 UTC (permalink / raw)
  To: Wei Weng <wweng@kencast.com>; +Cc: pgsql-sql

Hi Wei,

I hadn't tried that, and it did the trick!

Thank you!

George

----- Original Message ----- 
From: "Wei Weng" <wweng@kencast.com>
To: "George Weaver" <georgew1@mts.net>
Cc: <pgsql-sql@postgresql.org>
Sent: Friday, September 26, 2003 2:16 PM
Subject: Re: [SQL] Capturing pgsql ERRORS/NOTICES to file


> George:
>
> Have you tried psql {whatever operations} 2> error_output ?
>
> (for Bash)
>
> Thanks
>
> Wei
>
>
> On Fri, 26 Sep 2003, George Weaver wrote:
>
> > Hi Josh,
> >
> > Thanks for the reply.
> >
> > What I am trying to achieve is to have errors go to a file, rather than
show
> > up on the screen.
> >
> > Is this possible?
> >
> > George
> >
> > ----- Original Message ----- 
> > From: "Josh Berkus" <josh@agliodbs.com>
> > To: "George Weaver" <georgew1@mts.net>; <pgsql-sql@postgresql.org>
> > Sent: Friday, September 26, 2003 1:33 PM
> > Subject: Re: [SQL] Capturing pgsql ERRORS/NOTICES to file
> >
> >
> > > George,
> > >
> > > > I am in the process of creating a batch file that will update some
> > > > functions in a database for a remote user similar to:
> > > >
> > > > psql -o output dbname < functionupdate.sql
> > > >
> > > > Is there any way to save any ERROR and NOTICE messages to a file?
> > > >
> > > > The -o option doesn't capture this information.
> > >
> > > You have to use command shell redirects.
> > >
> > > For example, I commonly do in bash
> > > psql -o output dbname < functionupdate.sql >out.dump
> > > ... which sends all the command responses to a file, allowing me to
read
> > only
> > > the errors on the screen.
> > >
> > > See a guide to your shell for more creative redirection.
> > >
> > > -- 
> > > Josh Berkus
> > > Aglio Database Solutions
> > > San Francisco
> > >
> > > ---------------------------(end of
broadcast)---------------------------
> > > TIP 2: you can get off all lists at once with the unregister command
> > >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.or
g)
> > >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 9: the planner will ignore your desire to choose an index scan if
your
> >       joining column's datatypes do not match
> >
>




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-09-26 19:46 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-26 18:00 Capturing pgsql ERRORS/NOTICES to file George Weaver <georgew1@mts.net>
2003-09-26 18:33 ` Josh Berkus <josh@agliodbs.com>
2003-09-26 19:15   ` George Weaver <georgew1@mts.net>
2003-09-26 19:16     ` Wei Weng <wweng@kencast.com>
2003-09-26 19:46       ` George Weaver <georgew1@mts.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox