Re: [HACKERS] Extending COPY TO

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 09:23 AM, Andrea Riciputi wrote: Imagine you access PG from an application written in the language X using a driver library, both your application and your PG instance run on two different hosts. In that scenario, you'll be using the PQgetCopyData function to get the data. PQgetC

Re: [HACKERS] Extending COPY TO

2014-09-23 Thread Andrea Riciputi
Hi all, thanks for all your answers, I see your point. And I also understand the argument according to which there always be some other use case to satisfy. However your suggestion to use COPY TO sql TO PROGRAM doesn’t seem to me to fit well the use case I have in mind. Imagine you access PG f

Re: [HACKERS] Extending COPY TO

2014-09-22 Thread Stephen Frost
Andrea, * Andrea Riciputi (andrea.ricip...@gmail.com) wrote: > My idea was to extend the COPY TO command to accept an EOL option as it > already does with the DELIMITER option. To keep it simple we can limit the > EOL choice to CR, LF or CRLF to avoid unusual output, and also keep the > current

Re: [HACKERS] Extending COPY TO

2014-09-22 Thread Heikki Linnakangas
On 09/23/2014 09:49 AM, Andrea Riciputi wrote: My idea was to extend the COPY TO command to accept an EOL option as it already does with the DELIMITER option. To keep it simple we can limit the EOL choice to CR, LF or CRLF to avoid unusual output, and also keep the current behaviour when no EOL o

[HACKERS] Extending COPY TO

2014-09-22 Thread Andrea Riciputi
Hi all, it’s my first time here, so please let me know if I’m doing something wrong. I’m a developer, heavy PG user, but I’ve never hacked it before. Last week at work we had to produce a quite big CSV data file which should be used as input by another piece of software. Since the file must be