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 +4 -4
- data/classpath/{embulk-output-jdbc-0.7.4.jar → embulk-output-jdbc-0.7.5.jar} +0 -0
- data/classpath/{embulk-output-postgresql-0.7.4.jar → embulk-output-postgresql-0.7.5.jar} +0 -0
- data/src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnection.java +12 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3863e5cf2835518edb2710386f0dcdb3ac8b1ed1
|
4
|
+
data.tar.gz: 8a408a2f962f2c95baad05a3a0718d24d699796d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c162734de786c6cf5c330f0ecd9c65284e3223cc7f9deda4ecac50846fe7a7466c78659ab1f306d873e15177fd574683d28c17073d70b7c6a2898e49dd360d12
|
7
|
+
data.tar.gz: 20011d0168ee399acd7739196373467626ff8a467ba0495fee244d8858c9c7cc727b2a89a8a81e177e30213eaf1c6d081d9f2f3b7158dfad3f1d6184d0d56cf2
|
Binary file
|
Binary file
|
@@ -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
|
-
|
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
|
+
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-
|
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.
|
23
|
-
- classpath/embulk-output-postgresql-0.7.
|
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
|