Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006

    Unanswered: Delimiter in Postgresql

    I'm writing a script that can get the table dump from the postgresql and writing it into xml file.

    echo "select * from emp" | psql -t -q employee postgres | sed 's/|/ /g | while read line

    In the above line, I'm getting the details from the table emp from the database employee. I'm using -t to turnoff the colomn headings and -q to quit after the query is executed. Sed to parse the entire outputstream and replace | with a space.

    This is limiting me from entering a name with space seperated.

    Can any one tell me what is the delimiter of postgresql?

    Awaiting quick response,


  2. #2
    Join Date
    Nov 2003
    Why don't you just use pg_dump ( instead of running a SELECT statement, since you're just dumping to a file? The fields are then comma-separated (or whatever delimiter you choose).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts