embulk-output-postgresql 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e6b8490c586c3ed31c6046062730e0d25f96ba9
4
- data.tar.gz: 9548fd542f96b21a622253b63122415f4ee1d803
3
+ metadata.gz: 3863e5cf2835518edb2710386f0dcdb3ac8b1ed1
4
+ data.tar.gz: 8a408a2f962f2c95baad05a3a0718d24d699796d
5
5
  SHA512:
6
- metadata.gz: 92dc738886c1b48dd1bcdf9680a175930726d7bea375de73b3c401c5b7a16b64ff5e0fc41a4685c600884a2bcc4a48b4924c2687e51c1152b96b6200d1496f50
7
- data.tar.gz: 864a1dd24033f19c26b88fc866a14e94757459c829de10eafe6208f23b3946872204e753293cc7504d98b4b0c4ee4752b6a50e98f26c2992a67e9db1ee97ff65
6
+ metadata.gz: c162734de786c6cf5c330f0ecd9c65284e3223cc7f9deda4ecac50846fe7a7466c78659ab1f306d873e15177fd574683d28c17073d70b7c6a2898e49dd360d12
7
+ data.tar.gz: 20011d0168ee399acd7739196373467626ff8a467ba0495fee244d8858c9c7cc727b2a89a8a81e177e30213eaf1c6d081d9f2f3b7158dfad3f1d6184d0d56cf2
@@ -15,6 +15,8 @@ import org.embulk.output.jdbc.JdbcSchema;
15
15
  public class PostgreSQLOutputConnection
16
16
  extends JdbcOutputConnection
17
17
  {
18
+ private static final int MAX_NUMERIC_PRECISION = 1000;
19
+
18
20
  public PostgreSQLOutputConnection(Connection connection, String schemaName, boolean autoCommit)
19
21
  throws SQLException
20
22
  {
@@ -251,8 +253,17 @@ public class PostgreSQLOutputConnection
251
253
  // but cannot create column of varchar(2147483647) .
252
254
  return "VARCHAR";
253
255
  }
256
+ break;
257
+ case "NUMERIC": // only "NUMERIC" because PostgreSQL JDBC driver will return also "NUMERIC" for the type name of decimal.
258
+ if (c.getDataLength() > MAX_NUMERIC_PRECISION) {
259
+ // getDataLength for numeric without precision will return 131089 .
260
+ // but cannot create column of numeric(131089) .
261
+ return "NUMERIC";
262
+ }
263
+ break;
254
264
  default:
255
- return super.buildColumnTypeName(c);
265
+ break;
256
266
  }
267
+ return super.buildColumnTypeName(c);
257
268
  }
258
269
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-postgresql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-24 00:00:00.000000000 Z
11
+ date: 2017-03-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Inserts or updates records to a table.
14
14
  email:
@@ -19,8 +19,8 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - README.md
21
21
  - build.gradle
22
- - classpath/embulk-output-jdbc-0.7.4.jar
23
- - classpath/embulk-output-postgresql-0.7.4.jar
22
+ - classpath/embulk-output-jdbc-0.7.5.jar
23
+ - classpath/embulk-output-postgresql-0.7.5.jar
24
24
  - classpath/postgresql-9.4-1205-jdbc41.jar
25
25
  - lib/embulk/output/postgresql.rb
26
26
  - src/main/java/org/embulk/output/PostgreSQLOutputPlugin.java