COPY can t make file - Mailing list pgsql-general

From Ulf Mehlig
Subject COPY can t make file
Date
Msg-id 14642.52868.621559.704150@vmgateway.vmnet.localnet
Whole thread Raw
List pgsql-general
Hello out there,

I've found a somehow strange behaviour of postgreSQL 7.0; consider the
following:

  1. user umehlig, in psql:
  =========================
  db=# COPY blatt TO '/usr/local/tmp/blatt.txt' USING DELIMITERS '|' with null as '';
  ERROR: COPY command, running in backend with effective uid 1100,
  could not open file '/usr/local/tmp/blatt.txt' for writing.  Errno =
  Keine Berechtigung (13). -- "Keine Berechtigung": "no permission"

  2. user postgres, outside psql:
  ===============================
  [postgres@pandora3 pgsql]$ grep 1100 /etc/passwd
  postgres:*:1100:1100:PostgreSQL Super User:/usr/local/pgsql:/bin/sh
  [postgres@pandora3 pgsql]$ grep postgres /etc/group
  users::100:umehlig,postgres
  postgres:*:1100:postgres
  [postgres@pandora3 pgsql]$ touch /usr/local/tmp/blatt.txt
  [postgres@pandora3 pgsql]$ ls -ld /usr/local/tmp/ /usr/local/tmp/blatt.txt
  drwxrwxr-t   3 root     users         144 May 29 21:47 /usr/local/tmp/
  -rw-rw-r--   1 postgres postgres    19011 May 29 21:48 /usr/local/tmp/blatt.txt

  3. user umehlig, in psql:
  =========================
  db=# COPY blatt TO '/usr/local/tmp/blatt.txt' USING DELIMITERS '|' with null as '';
  COPY

The COPY command does succeed only after manually generating the file
-- is there something wrong with my permissions, or is there something
wrong with the COPY command?

Thanxs,
Ulf


psql (PostgreSQL) 7.0.0
RedHat 6.1/i386, kernel 2.2.14

--
======================================================================
Ulf Mehlig    <ulf.mehlig@zmt.uni-bremen.de>
              Center for Tropical Marine Ecology/ZMT, Bremen, Germany
----------------------------------------------------------------------

pgsql-general by date:

Previous
From: Erich
Date:
Subject: Re: Postgresql usage clip.
Next
From: Rich Teer
Date:
Subject: Is PostgreSQL multi-threaded?