PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 28th, 2002, 01:31 AM
ggnanaraj ggnanaraj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 69 ggnanaraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 55 sec
Reputation Power: 11
Command to remove feedback, echo ??

When I execute the following query, I get ...

Quote:
test=# select 'pg_dump hris > hris'||name from d_conf_backup;
?column?
----------------------------------
pg_dump hris > hris28AUG20021128
(1 row)

test=#


... Now, is there any option to remove the heading and feedback, so as to display ...

pg_dump hris > hris28AUG20021128

... alone ?? The reason for this being, I want to spool this to a file to execute that file as a cron job.

Thanks & Regards.

Reply With Quote
  #2  
Old August 28th, 2002, 04:15 AM
donarb donarb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 1999
Location: Seattle
Posts: 133 donarb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
Use the -t option to psql. Also use the -c option to have psql run the query and exit immediately. So to use it, like for a cron job, code it like this:

Code:
psql mydb -t -c "select 'pg_dump hris > hris'||name from d_conf_backup" > filename.txt


This puts the output into a file called filename.txt.

Don

Reply With Quote
  #3  
Old August 29th, 2002, 12:44 AM
ggnanaraj ggnanaraj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 69 ggnanaraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 55 sec
Reputation Power: 11
Smile

Hi Don

Thanks! That solved it.

Cheers.

Best Regards.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Command to remove feedback, echo ??

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap