You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-10Lines changed: 45 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,7 @@ Before initiating the build and installation process, ensure the following prere
46
46
- Unsupported data types: blob, long, longraw, bytea.
47
47
- Cross-platform comparison limitations with boolean type.
48
48
- Low precission types (float, real) cannot be compared to high precission types (double).
49
+
- All low precission types are cast using a scale of 3. If a higher scale is required consider using the map-expression override option.
49
50
- Different databases cast float to different values. Use float-cast option to switch between char and notation (scientific notation) if there are compare problems with float data types.
50
51
51
52
# Getting Started
@@ -72,37 +73,62 @@ At a minimal the `repo-xxxxx` parameters are required in the properties file (or
72
73
Run the script or use the command below to set up the PostgreSQL repository:
73
74
74
75
```shell
75
-
java -jar pgcompare.jar --init
76
+
java -jar pgcompare.jar init
76
77
```
77
78
78
79
## 5. Discover Tables
79
80
80
81
Discover and map tables in specified schemas:
81
82
82
83
```shell
83
-
java -jar pgcompare.jar --discovery
84
+
java -jar pgcompare.jar discover
84
85
```
85
86
86
87
# Usage
87
88
89
+
## Command Line
90
+
91
+
```shell
92
+
java -jar pgcompare.jar <action><options>
93
+
```
94
+
95
+
Actions:
96
+
-**check**: Recompare the out of sync rows from previous compare
97
+
-**compare**: Perform database compare
98
+
-**copy-table**: Copy pgCompare metadata for table. Must specify table alias to copy using --table option
99
+
-**discover**: Disocver tables and columns
100
+
-**init**: Initialize the repository database
101
+
102
+
Options:
103
+
104
+
-b|--batch {batch nbr}
105
+
106
+
-p|--project Project ID
107
+
108
+
-r|--report {file} Create html report of compare
109
+
110
+
-t|--table {target table}
111
+
112
+
--help
113
+
88
114
## Define Table Mapping
89
115
90
116
1. Automatic Discovery
91
117
92
118
Discover and map tables in specified schemas:
93
119
94
120
```shell
95
-
java -jar pgcompare.jar --discover
121
+
java -jar pgcompare.jar discover
96
122
```
97
123
98
124
2. Manual Registration
99
125
100
-
Insert mappings into `dc_table`and `dc_table_map` tables in the repository.
126
+
Insert mappings into `dc_table`, `dc_table_map`, `dc_table_column`, and `dc_table_column_map` tables in the repository.
101
127
102
128
## Run Data Comparison
103
129
104
130
```shell
105
-
java -jar pgcompare.jar --batch 0
131
+
java -jar pgcompare.jar compare --batch 0
106
132
```
107
133
108
134
Batch 0 processes all data. Use `PGCOMPARE-BATCH` or specify the batch number using the `--batch` argument to specify a batch number.
@@ -112,11 +138,20 @@ Batch 0 processes all data. Use `PGCOMPARE-BATCH` or specify the batch number us
112
138
Revalidate flagged rows:
113
139
114
140
```shell
115
-
java -jar pgcompare.jar --batch 0 --check
141
+
java -jar pgcompare.jar check --batch 0
116
142
```
117
143
118
144
# Upgrading
119
145
146
+
## Version 0.4.0 Enhancements
147
+
148
+
- Improved casting of low precision data types.
149
+
- Added html report generation.
150
+
- Refactored code for efficiency.
151
+
- Modified arguments and added 'verb' clause to command line.
152
+
153
+
**Note:** Drop and recreate the repository to upgrade to 0.4.0.
154
+
120
155
## Version 0.3.0 Enhancements
121
156
122
157
- DB2 support.
@@ -188,11 +223,11 @@ FROM dc_source s
188
223
Properties are categorized into four sections: system, repository, source, and target. Each section has specific properties, as described in detail in the documentation. The properties can be specified via a configuration file, environment variables or a combination of both. To use environment variables, the environment variable will be the name of the property in upper case with dashes '-' converted to underscore '_' and prefixed with PGCOMPARE_. For example, batch-fetch-size can be set by using the environment variable PGCOMPARE_BATCH_FETCH_SIZE.
189
224
190
225
### System
226
+
191
227
- batch-fetch-size: Sets the fetch size for retrieving rows from the source or target database.
192
228
- batch-commit-size: The commit size controls the array size and number of rows concurrently inserted into the dc_source/dc_target staging tables.
193
229
- batch-progress-report-size: Defines the number of rows used in mod to report progress.
194
-
- database-source: Determines if the sorting of the rows based on primary key occurs on the source/target database. If set to true, the default, the rows will be sorted before being compared. If set to false, the sorting will take place in the repository database.
195
-
- float-cast: Defines how float and double data types are cast for hash function (notation|char). Default is char.
230
+
- database-sort: Determines if the sorting of the rows based on primary key occurs on the source/target database. If set to true, the default, the rows will be sorted before being compared. If set to false, the sorting will take place in the repository database.
196
231
- loader-threads: Sets the number of threads to load data into the temporary tables. Default is 4. Set to 0 to disable loader threads.
197
232
- log-level: Level to determine the amount of log messages written to the log destination.
198
233
- log-destination: Location where log messages will be written. Default is stdout.
@@ -201,6 +236,8 @@ Properties are categorized into four sections: system, repository, source, and t
201
236
- observer-throttle: Set to true or false, instructs the loader threads to pause and wait for the observer thread to catch up before continuing to load more data into the staging tables.
202
237
- observer-throttle-size: Number of rows loaded before the loader thread will sleep and wait for clearance from the observer thread.
203
238
- observer-vacuum: Set to true or false, instructs the observer whether to perform a vacuum on the staging tables during checkpoints.
239
+
- stage-table-parallel: Default parallel degree to set on staging table (default: 0)
240
+
- standard-number-format: Format used to cast numbers (default:0000000000000000000000.0000000000000000000000)
204
241
205
242
### Repository
206
243
@@ -214,7 +251,6 @@ Properties are categorized into four sections: system, repository, source, and t
214
251
215
252
### Source
216
253
217
-
- source-database-hash: True or false, instructs the application where the hash should be computed (on the database or by the application).
218
254
- source-dbname: Database or service name.
219
255
- source-host: Database server name.
220
256
- source-password: Database password.
@@ -226,7 +262,6 @@ Properties are categorized into four sections: system, repository, source, and t
226
262
227
263
### Target
228
264
229
-
- target-database-hash: True or false, instructs the application where the hash should be computed (on the database or by the application).
0 commit comments