pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedRunning sql files
7+ messages / 5 participants
[nested] [flat]
* Running sql files
@ 2004-12-07 11:55 Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
2004-12-07 16:54 ` Re: Running sql files Jaime Casanova <systemguards@yahoo.com>
2004-12-07 17:01 ` Re: Running sql files Michael Fuhr <mike@fuhr.org>
2004-12-08 15:19 ` Re: Running sql files John DeSoi <desoi@pgedit.com>
0 siblings, 3 replies; 7+ messages in thread
From: Pradeepkumar, Pyatalo (IE10) @ 2004-12-07 11:55 UTC (permalink / raw)
To: pgsql-admin
Hi,
I just wanted to know how to disable the results being displayed on the
screen.
When I try the following command -
$psql dbname < sqlfile
The results of the command are displayed on to the screen. In one file I am
trying to populate a table with values ( There are more than 5000 tuples to
be inserted).
When I run this command, it displays the results on to the screen which I
don't want to do.
Could anyone help me in this.
Thanks in advance.
Regards,
Pradeep
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Running sql files
2004-12-07 11:55 Running sql files Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
@ 2004-12-07 16:54 ` Jaime Casanova <systemguards@yahoo.com>
2 siblings, 0 replies; 7+ messages in thread
From: Jaime Casanova @ 2004-12-07 16:54 UTC (permalink / raw)
To: pgsql-admin
--- "Pradeepkumar, Pyatalo (IE10)"
<Pradeepkumar.Pyatalo@honeywell.com> escribió:
>
> Hi,
>
> I just wanted to know how to disable the results
> being displayed on the
> screen.
> When I try the following command -
> $psql dbname < sqlfile
> The results of the command are displayed on to the
> screen. In one file I am
> trying to populate a table with values ( There are
> more than 5000 tuples to
> be inserted).
> When I run this command, it displays the results on
> to the screen which I
> don't want to do.
> Could anyone help me in this.
>
$psql dbname < sqlfile > /dev/null
regards,
Jaime Casanova
_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Running sql files
2004-12-07 11:55 Running sql files Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
@ 2004-12-07 17:01 ` Michael Fuhr <mike@fuhr.org>
2 siblings, 0 replies; 7+ messages in thread
From: Michael Fuhr @ 2004-12-07 17:01 UTC (permalink / raw)
To: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>; +Cc: pgsql-admin
On Tue, Dec 07, 2004 at 04:55:24AM -0700, Pradeepkumar, Pyatalo (IE10) wrote:
> $psql dbname < sqlfile
> The results of the command are displayed on to the screen. In one file I am
> trying to populate a table with values ( There are more than 5000 tuples to
> be inserted).
> When I run this command, it displays the results on to the screen which I
> don't want to do.
As someone else suggested, you could redirect the script's output
to /dev/null. You could also use psql's -q ("quiet") option or
surround certain parts of the file with "\set QUIET" and "\unset
QUIET".
COPY is quieter and more efficient than INSERT, so if you're using
INSERT then you could replace it with the appropriate COPY statement.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Running sql files
2004-12-07 11:55 Running sql files Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
@ 2004-12-08 15:19 ` John DeSoi <desoi@pgedit.com>
2 siblings, 0 replies; 7+ messages in thread
From: John DeSoi @ 2004-12-08 15:19 UTC (permalink / raw)
To: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>; +Cc: pgsql-admin
On Dec 7, 2004, at 6:55 AM, Pradeepkumar, Pyatalo (IE10) wrote:
> I just wanted to know how to disable the results being displayed on
> the screen.
> When I try the following command -
> $psql dbname < sqlfile
> The results of the command are displayed on to the screen. In one
> file I am trying to populate a table with values ( There are more than
> 5000 tuples to be inserted).
>
> When I run this command, it displays the results on to the screen
> which I don't want to do.
> Could anyone help me in this.
You can also send the output to a file with the -o option. That way,
you can review the results if any problems arise.
$psql -o myoutput dbname < sqlfile
See the psql section in the manual for more options to control the
output.
Best,
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Running sql files
@ 2004-12-07 12:01 Kevin Izzet <Kevin.Izzet@nsc.com>
0 siblings, 0 replies; 7+ messages in thread
From: Kevin Izzet @ 2004-12-07 12:01 UTC (permalink / raw)
To: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>; +Cc: pgsql-admin; pgsql-admin-owner@postgresql.org
Hi,
You could try running the command like this
$psql dbname < sqlfile > /dev/null
I believe this should work fine
Regards
Kevin Izzet
Database / Unix / Linux Administrator
Tel: (Code)+44(0)1475 655606
Fax: (Code)+44(0)1475 637755
Email: Kevin.Izzet@nsc.com
"Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo@honeywell.com>
Sent by: pgsql-admin-owner@postgresql.org
07/12/2004 11:55
To: pgsql-admin@postgresql.org
cc:
Subject: [ADMIN] Running sql files
Hi,
I just wanted to know how to disable the results being displayed on the
screen.
When I try the following command -
$psql dbname < sqlfile
The results of the command are displayed on to the screen. In one file I
am trying to populate a table with values ( There are more than 5000
tuples to be inserted).
When I run this command, it displays the results on to the screen which I
don't want to do.
Could anyone help me in this.
Thanks in advance.
Regards,
Pradeep
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Running sql files
@ 2004-12-08 05:23 Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
2004-12-08 05:42 ` Re: Running sql files Michael Fuhr <mike@fuhr.org>
0 siblings, 1 reply; 7+ messages in thread
From: Pradeepkumar, Pyatalo (IE10) @ 2004-12-08 05:23 UTC (permalink / raw)
To: Michael Fuhr <mike@fuhr.org>; Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>; +Cc: pgsql-admin
Hi all,
Thanks a lot for all your valuable inputs. I tried "\set QUIET" and "\unset
QUIET" arount certain parts of the file. It works fine with INSERT COMMANDS.
But incase of creating tables, it still prints NOTICE and ERROR messages on
the screen...how do I restrict that.
Regs,
Pradeep
-----Original Message-----
From: Michael Fuhr [mailto:mike@fuhr.org]
Sent: Tuesday, December 07, 2004 10:32 PM
To: Pradeepkumar, Pyatalo (IE10)
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Running sql files
On Tue, Dec 07, 2004 at 04:55:24AM -0700, Pradeepkumar, Pyatalo (IE10)
wrote:
> $psql dbname < sqlfile
> The results of the command are displayed on to the screen. In one
> file I am trying to populate a table with values ( There are more than
> 5000 tuples to be inserted).
> When I run this command, it displays the results on to the screen
> which I don't want to do.
As someone else suggested, you could redirect the script's output to
/dev/null. You could also use psql's -q ("quiet") option or surround
certain parts of the file with "\set QUIET" and "\unset QUIET".
COPY is quieter and more efficient than INSERT, so if you're using INSERT
then you could replace it with the appropriate COPY statement.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Running sql files
2004-12-08 05:23 Re: Running sql files Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
@ 2004-12-08 05:42 ` Michael Fuhr <mike@fuhr.org>
0 siblings, 0 replies; 7+ messages in thread
From: Michael Fuhr @ 2004-12-08 05:42 UTC (permalink / raw)
To: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>; +Cc: pgsql-admin
On Tue, Dec 07, 2004 at 10:23:44PM -0700, Pradeepkumar, Pyatalo (IE10) wrote:
> Thanks a lot for all your valuable inputs. I tried "\set QUIET" and "\unset
> QUIET" arount certain parts of the file. It works fine with INSERT COMMANDS.
> But incase of creating tables, it still prints NOTICE and ERROR messages on
> the screen...how do I restrict that.
You could SET the client_min_messages variable. See the documentation
for the SET command and the "Run-time Configuration" section in the
"Server Run-time Environment" chapter.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2004-12-08 15:19 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-12-07 11:55 Running sql files Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
2004-12-07 16:54 ` Jaime Casanova <systemguards@yahoo.com>
2004-12-07 17:01 ` Michael Fuhr <mike@fuhr.org>
2004-12-08 15:19 ` John DeSoi <desoi@pgedit.com>
2004-12-07 12:01 Re: Running sql files Kevin Izzet <Kevin.Izzet@nsc.com>
2004-12-08 05:23 Re: Running sql files Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
2004-12-08 05:42 ` Michael Fuhr <mike@fuhr.org>
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