#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Chennai, India
    Posts
    69
    Rep Power
    12

    Command to remove feedback, echo ??


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

    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.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 1999
    Location
    Seattle
    Posts
    133
    Rep Power
    16
    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
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Chennai, India
    Posts
    69
    Rep Power
    12

    Smile


    Hi Don

    Thanks! That solved it.

    Cheers.

    Best Regards.

IMN logo majestic logo threadwatch logo seochat tools logo