Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zvq4E-00019N-OT for pgsql-sql@arkaria.postgresql.org; Mon, 09 Nov 2015 17:17:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zvq4E-0000e7-B4 for pgsql-sql@arkaria.postgresql.org; Mon, 09 Nov 2015 17:17:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zvq3G-0007zp-L0 for pgsql-sql@postgresql.org; Mon, 09 Nov 2015 17:16:18 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zvq3C-0000Oz-6B for pgsql-sql@postgresql.org; Mon, 09 Nov 2015 17:16:17 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 46089200C3 for ; Mon, 9 Nov 2015 12:13:28 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Mon, 09 Nov 2015 12:13:28 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=Yib9vyvFI//FIPYAjw453cZiDVg=; b=C5AoJg OAjNFyqAVn+b+ZIdVRZ2yfLKXLVOpSHuAjxmIVUJvMp0N/cDDoEGm9UtOf78PeA/ otZOp3+IcqC4EPex3X3L3oCyVXcLrIG9K9YZ3NviWpCFAJMNc2gA/rlSEjaPEEgi tM8CTv0Ybapp6f29utbXU7fS7qI/QA3M+F5Co= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Yib9vyvFI//FIPY Ajw453cZiDVg=; b=QY+8q6QwGjSiP/VhHZn/wEK7IjdNBS8yPWxjH1Z3Sd6dMtC JDGCGfEcLSQ91u9GKEnr2tF4slDk7XnhxbVXmJROczs/koVNn95Pcf4CsaFYUEA4 Wdq9DnSEjsDgkdhxbqxls0IjqZ1xf98Lfky2kXw+756BOvMMtigdh6PF/vnE= X-Sasl-enc: xBdKfaQb3+Bw894hWwIRRgwSztnB2qB/t4yiVOfuoxuD 1447089207 Received: from killi.site (c-24-17-179-185.hsd1.wa.comcast.net [24.17.179.185]) by mail.messagingengine.com (Postfix) with ESMTPA id AEEBD68016C; Mon, 9 Nov 2015 12:13:27 -0500 (EST) Subject: Re: query option in COPY postgres To: masyaf , pgsql-sql@postgresql.org References: <1446841356122-5873015.post@n5.nabble.com> <563D2C74.8050408@aklaver.com> <1446850486076-5873038.post@n5.nabble.com> From: Adrian Klaver Message-ID: <5640D444.30801@aklaver.com> Date: Mon, 9 Nov 2015 09:13:40 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1446850486076-5873038.post@n5.nabble.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 11/06/2015 02:54 PM, masyaf wrote: > Can you give any details about that? > I am assuming you are referring to COPY FROM a program. Take a look at the docs: http://www.postgresql.org/docs/9.4/interactive/sql-copy.html "When PROGRAM is specified, the server executes the given command and reads from the standard output of the program, or writes to the standard input of the program. The command must be specified from the viewpoint of the server, and be executable by the PostgreSQL user. When STDIN or STDOUT is specified, data is transmitted via the connection between the client and the server." In my case I would write the program in Python and output CSV. Every time I do that though, I just go ahead and use the copy_from() method of the psycopg2 cursor and never get to the above. > > > -- > View this message in context: http://postgresql.nabble.com/query-option-in-COPY-postgres-tp5873015p5873038.html > Sent from the PostgreSQL - sql mailing list archive at Nabble.com. > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql