Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8RCF-0004lE-1o for pgsql-general@arkaria.postgresql.org; Fri, 05 Oct 2018 14:35:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g8RCD-0004Ks-LF for pgsql-general@arkaria.postgresql.org; Fri, 05 Oct 2018 14:35:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8RCD-0004Kk-7W for pgsql-general@lists.postgresql.org; Fri, 05 Oct 2018 14:35:13 +0000 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g8RCA-00077Q-Of for pgsql-general@lists.postgresql.org; Fri, 05 Oct 2018 14:35:12 +0000 Received: by mail-oi1-x241.google.com with SMTP id e17-v6so10561808oib.4 for ; Fri, 05 Oct 2018 07:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=8Jg1u0zePug362j5btG+d++h9RrinnQyKDL+/I5Whs4=; b=bqkkIQ7JPspo/yCK3kr54AI7GFxl62V+5B6NJ1Gv4DRHEjEK44kHoh5AUCDaGmnu3t z4OJJC5TP38pY86sms/IxmWNTaQxcJPtW32DyfISqXMckH0UhLjgav8A7a8+yqQDc0WW vfXXeKDZhETFweWqVZORMQS+zsiJxkZYLhCp9ToF+n1XfN/nec3/VMOqukbiRoofGZoI kPug/R9j/0vjL8fZA4NsFTjS7PED/Cg6WgF/+KZ6AA9JYG9cA1Fojx6Sh2YajFEifIeT VMjs1r+fgiCl4GRpc5e/klksJuuk2SBaAFJjhORFqRYvxkIn0mUW87FJmDoy+sMumlsg XMRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=8Jg1u0zePug362j5btG+d++h9RrinnQyKDL+/I5Whs4=; b=ujcEPX9BOyADKVNqxRUgzN1jy0eypy74FMcokd517zNfrX78W4M/6MENf/GIf8j0+e UugNe++aIWogGn3X1256kYisfILa0+C0LNR8Q+ONb4kkTzxZ7G3KJmIzhXiqEknzUoJY HwKr0ZrPrlaLqC61pORQIkkgVnWIKLv4KystE3L0Q2jHaqvMbVuEylC262a9IJTM27z7 3TR2uEY5LeZ+zUG6QgRYikWX2wup/eBjMjTspDrTnprCGr3DNxjOJLfuzImadA5C2agb aTdvrzH7P2wWjCeBCsvLv4/8TfiNg3xgCyw9bHaDMkNWdBQoryx7l0GZyy4jkHhTLFM+ oukw== X-Gm-Message-State: ABuFfojdP/89B9rjnrFvNSXw9ZgLCfUXEu5y6XBlDSBKdsiDvl7pSY2y KwOdz2SAtxnCfsy4Fl/iKTW7/ku2 X-Google-Smtp-Source: ACcGV61C71Dy3EBEYT28jKbmOCXNJB6e9HrtcO9B2X5eRHDbcDCm6HHImmkEfiCIQE/LTLu5Z4LM5A== X-Received: by 2002:aca:5053:: with SMTP id e80-v6mr5169259oib.352.1538750109681; Fri, 05 Oct 2018 07:35:09 -0700 (PDT) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id w79-v6sm2592679oie.29.2018.10.05.07.35.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Oct 2018 07:35:08 -0700 (PDT) Subject: Re: COPY from a remote machine in Datastage To: pgsql-general@lists.postgresql.org References: <1538733298001-0.post@n3.nabble.com> <68fdc7e7-3a29-ef03-fe5c-5971e357788c@portavita.eu> From: Ron Message-ID: <2e987deb-1529-644b-4b14-a37dd517b856@gmail.com> Date: Fri, 5 Oct 2018 09:35:07 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------605961266F2936AD55871FBE" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------605961266F2936AD55871FBE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 10/05/2018 09:18 AM, Ravi Krishna wrote: >> >> Hello, if you need to use COPY command from remote machine and you use >> some libpq bindings (aka ruby pg gem for example), you can use functions >> associated with COPY command >> (https://www.postgresql.org/docs/10/static/libpq-copy.html). They should >> be provided by bindings of postgres library you're using. >> >> If you can share more info, at least how do you access postgres (via Ruby >> gem for example or from client's console), I can try to be more descriptive. > > We not writing any Ruby/Python code.  We are using Datastage. Datastage > has in built features for most of the stuff. For example to bulk load data > from csv files > into Oracle/DB2 etc, it has a BULK loader feature. However DS has no > support for PG directly and we are piggy backing on ODBC where there is no > BULK loader. > > The only recourse for us is to type in SQL as DS allows user code. Can you install the postgres client software (psql) on the client machine and then have Datastage spawn "psql -c 'COPY ...'"? -- Angular momentum makes the world go 'round. --------------605961266F2936AD55871FBE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 10/05/2018 09:18 AM, Ravi Krishna wrote:

Hello, if you need to use COPY command from remote machine and you use some libpq bindings (aka ruby pg gem for example), you can use functions associated with COPY command (https://www.postgresql.org/docs/10/static/libpq-copy.html). They should be provided by bindings of postgres library you're using.

If you can share more info, at least how do you access postgres (via Ruby gem for example or from client's console), I can try to be more descriptive.

We not writing any Ruby/Python code.  We are using Datastage. Datastage has in built features for most of the stuff. For example to bulk load data from csv files
into Oracle/DB2 etc, it has a BULK loader feature. However DS has no support for PG directly and we are piggy backing on ODBC where there is no BULK loader.

The only recourse for us is to type in SQL as DS allows user code.

Can you install the postgres client software (psql) on the client machine and then have Datastage spawn "psql -c 'COPY ...'"?

--
Angular momentum makes the world go 'round.
--------------605961266F2936AD55871FBE--