Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCwUv-0005Or-G2 for pgsql-general@arkaria.postgresql.org; Thu, 09 Nov 2017 23:44:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eCwUu-0000r1-W1 for pgsql-general@arkaria.postgresql.org; Thu, 09 Nov 2017 23:44:37 +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.84_2) (envelope-from ) id 1eCwSS-0002RK-Dn for pgsql-general@postgresql.org; Thu, 09 Nov 2017 23:42:04 +0000 Received: from mail-pf0-x22e.google.com ([2607:f8b0:400e:c00::22e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eCwSP-00034U-Jg for pgsql-general@postgresql.org; Thu, 09 Nov 2017 23:42:03 +0000 Received: by mail-pf0-x22e.google.com with SMTP id 17so5399779pfn.12 for ; Thu, 09 Nov 2017 15:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lucee-org.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=f2WvIb81bwLlPGQXDLP1XKoORu5lxm9gmETQp3qzE0Y=; b=fwy5U/XkErm1bfMi8mecBMsRj3Xg3wpay40RJwYCM4I06EgQUj4pwDdGngwYBgElbs 38tdAL1rE1A6G0bIJ3cJkrTRQ6U/ffS1Rbbq7USQkVMYfOHCi5dqjRceZsaS16WLmbdR U1nW9pYeLDKEqMTyn81leDm+QcOOlko/MBbBoohDcxsb/lZoU6dDRFSdtYMxxtaLnJ3e FDYtz6Hnm/BsDEQ4jqtDsKEZXKCOLkeeWtH/49FNr6KAEmAR1qnSptQ5aaDju5I8K435 2nDSiXE+QeyrqRaj3K2AiP8e3Zfn3iuuWPO3WY+J6UAi0jxEAmIcdYqjvokwX5ZPscur h/gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=f2WvIb81bwLlPGQXDLP1XKoORu5lxm9gmETQp3qzE0Y=; b=iOQy0ylwpYYLLavcz2GhuLKUycR70XkVYx5kDrpB0KVKYnpG/tBaN1ovoLp7MEL9OT dnaAHFoPS5CAfYFR5uMYgAOuiThiVX1y6VZUNCvX6mFME87GppuH6TodjgaXE2ufZMIJ DZyR1plewoSZv/aAQZEKy6cB9UjiFZQpqK492z9tC2Wtfyi4mIPf3UFA6EofAKbIsg9e gBbOzs5b1zTCezApgM6nv/zm8yezFq0R6WBmLqmZoxGXModFLAFjRFN4eltE/kE7VEu1 4lwyCj9+TV6Gthy3E1ZIgsVeM7eh5G7pb7qgqJPb/1az64024VZTzr+mVA1cjCnVHrpY krHw== X-Gm-Message-State: AJaThX6ohq63OpQG3al3duZfnIoptwwaTD+fwUjyzA85ixyS7lhiwIyJ HgDQ7fxDLJTC72pJgEUdexmPvAxa X-Google-Smtp-Source: ABhQp+ShuOfQJ9h6Nlky2bJ6Mu7mo/xt/XANPg0Wm9sAOyREDjUyGlBpyVyjqu3Bc04Y9wouM+FAWg== X-Received: by 10.84.244.2 with SMTP id g2mr2101620pll.264.1510270920365; Thu, 09 Nov 2017 15:42:00 -0800 (PST) Received: from [192.168.1.15] (45-19-167-161.lightspeed.irvnca.sbcglobal.net. [45.19.167.161]) by smtp.googlemail.com with ESMTPSA id t25sm13144086pfh.67.2017.11.09.15.41.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 15:41:59 -0800 (PST) Subject: Re: Migrating money column from MS SQL Server to Postgres To: Merlin Moncure , Adam Brusselback Cc: Allan Kamau , Postgres General Postgres General References: <8acca674-ac7c-2b48-9a3e-8b8acf8b2c36@lucee.org> <4497.1510188301@sss.pgh.pa.us> <4b6a0bfb-0cbc-b407-feaa-0be86f06e4d9@lucee.org> <724bab58-87d9-7b02-867b-5d98b93aac7d@lucee.org> From: "Igal @ Lucee.org" Message-ID: <76a6857b-e488-7509-81fd-c6543fe949ee@lucee.org> Date: Thu, 9 Nov 2017 15:41:58 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------555D0000724F0C476AB36D82" Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------555D0000724F0C476AB36D82 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 11/9/2017 8:19 AM, Merlin Moncure wrote: > On Thu, Nov 9, 2017 at 8:22 AM, Adam Brusselback > wrote: >>> Since you are migrating data into a staging table in PostgreSQL, you may set >>> the field data type as TEXT for each field where you have noticed or >>> anticipate issues. >>> Then after population perform the datatype transformation query on the given >>> fields to determine the actual field value that could not be gracefully >>> transformed. >> This is the approach I have come to as the most successful for data migrations. >> >> I will use tools like Kettle / Talend to get data into a staging table >> with every column as text, then use SQL to migrate that to a properly >> typed table. Works much better than trying to work within the >> constraints of these tools. > YES > > I call the approach 'ELT', (Extract, Load, Trasform). You are much > better off writing transformations in SQL than inside of an ETL tool. > This is a perfect example of why. All sound advice.  Thanks. Igal Sapir Lucee Core Developer Lucee.org --------------555D0000724F0C476AB36D82 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 11/9/2017 8:19 AM, Merlin Moncure wrote:
On Thu, Nov 9, 2017 at 8:22 AM, Adam Brusselback
<adambrusselback@gmail.com> wrote:
Since you are migrating data into a staging table in PostgreSQL, you may set
the field data type as TEXT for each field where you have noticed or
anticipate issues.
Then after population perform the datatype transformation query on the given
fields to determine the actual field value that could not be gracefully
transformed.
This is the approach I have come to as the most successful for data migrations.

I will use tools like Kettle / Talend to get data into a staging table
with every column as text, then use SQL to migrate that to a properly
typed table.  Works much better than trying to work within the
constraints of these tools.
YES

I call the approach 'ELT', (Extract, Load, Trasform).  You are much
better off writing transformations in SQL than inside of an ETL tool.
This is a perfect example of why.

All sound advice.  Thanks.


Igal Sapir

Lucee Core Developer
Lucee.org

--------------555D0000724F0C476AB36D82--