public inbox for [email protected]  
help / color / mirror / Atom feed
Export Query Output to incremental csv file
3+ messages / 2 participants
[nested] [flat]

* Export Query Output to incremental csv file
@ 2024-08-08 14:26 Erik Serrano <[email protected]>
  2024-08-08 14:44 ` Re: Export Query Output to incremental csv file Ron Johnson <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Erik Serrano @ 2024-08-08 14:26 UTC (permalink / raw)
  To: Pgsql-admin <[email protected]>

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.

Thank you very much.
Regards.


*Erik R. Serrano Saavedra*
*Ingeniero de Sistemas Informáticos*
*      Data Base Administrator*

*        [email protected] <[email protected]>*


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Export Query Output to incremental csv file
  2024-08-08 14:26 Export Query Output to incremental csv file Erik Serrano <[email protected]>
@ 2024-08-08 14:44 ` Ron Johnson <[email protected]>
  2024-08-08 15:28   ` Re: Export Query Output to incremental csv file Erik Serrano <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Ron Johnson @ 2024-08-08 14:44 UTC (permalink / raw)
  To: Pgsql-admin <[email protected]>

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!


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Export Query Output to incremental csv file
  2024-08-08 14:26 Export Query Output to incremental csv file Erik Serrano <[email protected]>
  2024-08-08 14:44 ` Re: Export Query Output to incremental csv file Ron Johnson <[email protected]>
@ 2024-08-08 15:28   ` Erik Serrano <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Erik Serrano @ 2024-08-08 15:28 UTC (permalink / raw)
  To: Ron Johnson <[email protected]>; +Cc: Pgsql-admin <[email protected]>

Dear Sir,

This was exactly what I needed, the idea was to do the incremental export
in csv... of course I looked for some additional formats like "... stdout
with (format csv)" and it worked perfectly.

Thank you very much Ron for your help...
A hug


*Erik R. Serrano Saavedra*
*Ingeniero de Sistemas Informáticos*
*      Data Base Administrator*

*        [email protected] <[email protected]>*



El jue, 8 ago 2024 a las 10:44, Ron Johnson (<[email protected]>)
escribió:

> 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!
>


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-08-08 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-08-08 14:26 Export Query Output to incremental csv file Erik Serrano <[email protected]>
2024-08-08 14:44 ` Ron Johnson <[email protected]>
2024-08-08 15:28   ` Erik Serrano <[email protected]>

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