Thread: psql o and g options not working

psql o and g options not working

From
robin isard
Date:
Hi,

Whenever I try to use the \o or \g options to output a sql query to a
file, I always get a "File or directory does not exist error."  The
file does exist and I've given it every permission possible, ensured
it's owned by the postgres user, and made sure it's in a directory
postgres can write to.

What am I doing wrong?  I'm using postgresql 8.3.

thanks

Re: psql o and g options not working

From
Andreas Wenk
Date:
robin isard wrote:
> Hi,
>
> Whenever I try to use the \o or \g options to output a sql query to a
> file, I always get a "File or directory does not exist error."  The
> file does exist and I've given it every permission possible, ensured
> it's owned by the postgres user, and made sure it's in a directory
> postgres can write to.
>
> What am I doing wrong?  I'm using postgresql 8.3.

Can you provide the command you use in psql and the following error
message, the postgresql version you use and the operating system?

By the way. On a ubuntu box this is working for me:

test=# \g /tmp/bla.sql

tmp$ ll
-rw-r--r-- 1 postgres postgres  598 2009-08-09 22:32 bla.sql


Cheers

Andy