Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sc4NK-003dbW-NP for pgsql-admin@arkaria.postgresql.org; Thu, 08 Aug 2024 14:44:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sc4NI-00EuSE-So for pgsql-admin@arkaria.postgresql.org; Thu, 08 Aug 2024 14:44:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sc4NI-00EuS5-H4 for pgsql-admin@lists.postgresql.org; Thu, 08 Aug 2024 14:44:20 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sc4NG-003oTz-6n for pgsql-admin@lists.postgresql.org; Thu, 08 Aug 2024 14:44:19 +0000 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3db23a60850so722651b6e.0 for ; Thu, 08 Aug 2024 07:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723128256; x=1723733056; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=b0iLrxQ9zTV7ZqAtQv/czKlHjUIcUthYPSnFAp7Ad18=; b=OdA5HOTh80M/oDd7yAhmAvOd7ZpYH/2zKPwbiQfWa5Sg8reCzqjBJ589AQLU3y137B 1f6YQ3qRr4q762zQKtvGHoIy/V6tY4Qbn2Z1hn+Hjp70BJ+L1bCpm0Vb1hFC3hUvf/la BYXwXv1+tspI3BjhB71a43KqCCecP6T+Mc57mqH70i97505hlY9oQAC2SQJveIZaJsor CiMNQWWdAyz8A7gwlgrJ3im+88GVIglqltGVgN69rI6kgVV28rnN4Wu0bahXPJMhfWCY uNNYaO3xgmpenCSmeD03Bq8J4mZDB3kMrfAyaSQW286Y0B+sqticQX7MsdeilCUrJEKa myPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723128256; x=1723733056; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=b0iLrxQ9zTV7ZqAtQv/czKlHjUIcUthYPSnFAp7Ad18=; b=O92J2gSpkshDz9548J4ESl/y45t33yztG5sCmKFjNv1Pe8WSRXmSM/SgevDbgjAdUi svNmoTkHy5K+gJ+xZpOYJiHHSR4ZRtqA0y4KhJsYqgNxHbvJhjGd0Xlj/YL+vLpCxPMV xJ/G4FpMLDH61ZVbTNmfOTJwMwWwxAITrCSif98eF/l9JoqZ7lV5L1OW/0BcIvmTHahU E1SLkFmxHT4+KylKXBGdxlSdG/waR/KN7GaPv6gSBAanHEOz9Olg3qL2vwpVk1vGWm/E swkMlzYSmszgHjJ7PiIGF5jYjJAmxfGubynCgvMm+L17+HjXoERukMeXNIjzpxoGAsGe AKWQ== X-Gm-Message-State: AOJu0YxjmSOexcnpPp4kyMqe93q8addr9pL0hKpnGBPwmkwLuJo+bLX0 iLvshZSdHsKhaTmmTYipWJpLAaD4cQlO15+uDcr7YSAPR6c+PB0m+n/RsXGcN/UKS6v3/Jvk9k7 mD1inyZYROz3Cugx/8RggM0TQs4GTUQ== X-Google-Smtp-Source: AGHT+IGIjyumHrbyYF3preChWSpVnIakJVvySrf2ycg7HRiPKYIaXtNjEH68h34gaCDskkqf4DAVdpzf91ytfCUmDj8= X-Received: by 2002:a05:6808:10d3:b0:3da:a47a:99c6 with SMTP id 5614622812f47-3dc3b41ab81mr2140695b6e.15.1723128255978; Thu, 08 Aug 2024 07:44:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Thu, 8 Aug 2024 10:44:04 -0400 Message-ID: Subject: Re: Export Query Output to incremental csv file To: Pgsql-admin Content-Type: multipart/alternative; boundary="00000000000099a7b8061f2d0fe8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000099a7b8061f2d0fe8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Aug 8, 2024 at 10:26=E2=80=AFAM Erik Serrano = 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.) --=20 Death to America, and butter sauce. Iraq lobster! --00000000000099a7b8061f2d0fe8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable