BUG #2041: annoyance with COPY - Mailing list pgsql-bugs

From sebastien mayer
Subject BUG #2041: annoyance with COPY
Date
Msg-id 20051114083131.3BEA9F0DF0@svr2.postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2041
Logged by:          sebastien mayer
Email address:      sebastien.mayer@briosoft.com
PostgreSQL version: 8.04
Operating system:   linux fedora core 4
Description:        annoyance with COPY
Details:

in : copy  table to file
got the constraint that 'file' has to be a literal.
'file' can not be a text variable.
That is not fair !
I want peoples using my application creates backup of parts of the data. The
directory where the extracted data is something like :
/tmp/briosoft_temp/<UserID>/
So i construct a text variable to hold the filename.
In fact the whole command that i EXECUTE.
The usage could be simplified if you accept text variable as 'file'.
By the way, as soon as you want to deal with backups of datas and
large_objects, you touch the file system : in a large company, the 1000's of
users will not have all a DVD writer ! There is a centralized computer
department where peoples deals with archive DVD-ROM's and sometimes send
them back to the user who asked for it.
This means we need functions to mkdir, rmdir, even a system call in order to
tar and mkisofs the result of the backup/archive. We could even cdrecord !!
OK, you don't want SQL becomes PHP.
Anyway, with the opportunity to add functions with C, you may consider the
question answered.

have a good day....
seb

pgsql-bugs by date:

Previous
From: "Sebastien MAYER"
Date:
Subject: BUG #2040: buggy cast of INT8 to text
Next
From: "Magnus Hagander"
Date:
Subject: Re: BUG #2039: Problem with Installation