public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ron Johnson <[email protected]>
To: Pgsql-admin <[email protected]>
Subject: Re: Export Query Output to incremental csv file
Date: Thu, 8 Aug 2024 10:44:04 -0400
Message-ID: <CANzqJaCYnDHexB-QucpAtK8AZ6Aj8eyHKhDjwHjy+eENFuxZ7g@mail.gmail.com> (raw)
In-Reply-To: <CA+dvXXvA+=9fsf-C0HuPG4CGed12SSaL1T+yM4rLU6mgDOfkiQ@mail.gmail.com>
References: <CA+dvXXvA+=9fsf-C0HuPG4CGed12SSaL1T+yM4rLU6mgDOfkiQ@mail.gmail.com>

On Thu, Aug 8, 2024 at 10:26 AM Erik Serrano <[email protected]> wrote:

> Hi guys,
> I would like to ask a question about exporting a query output to a csv
> file but with the particularity that it is incremental (that is, the same
> file grows in size) since I need to do the query multiple times and I don't
> want to fill up with csv files... but rather just one that always grows, as
> if it were a log.
>
> I will add the query to a shell and schedule it using a crontab in Linux
> Centos.
>

COPY ... TO STDOUT, and then append that to the CSV file using ">>".

(Unless I misinterpret what you mean.)

-- 
Death to America, and butter sauce.
Iraq lobster!


view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Export Query Output to incremental csv file
  In-Reply-To: <CANzqJaCYnDHexB-QucpAtK8AZ6Aj8eyHKhDjwHjy+eENFuxZ7g@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox