Comments (6)
Hi,
-->Pg_bulkload is more like Sql loader in Oracle right? What if the table has indexes. Will it be rebuild after loading data as like oracle? Not sure, how this process works.
Yes, the indexes are rebuilt after loading data, not to updating indexes in insertition.
-->In pg_bulkloads, records will be inserted not updated. right?
Came across, few records got replaced. Is it because of ON_DUPLICATE_KEEP = NEW. Will that be be updated, or record will be removed and re-inserted. Kindly clarify that.
Yes, load records are inserted, not updated.
In default configuration,ON_DUPLICATE_KEEP does not work because DUPLICATE_ERRORS is non zero.
Could you tell us the situation more detail?
from pg_bulkload.
Thanks.
This is my case, where records got replaced and i have a settings as
DUPLICATE_ERRORS = 0
ON_DUPLICATE_KEEP = NEW
This is normal.right? If any record was already present, that particular record will be replaced by a record from source.
I have one more question. Will pg_bulkload disable the trigger before loading? I don't want to disable the trigger.
from pg_bulkload.
This is normal.right? If any record was already present, that particular record will be replaced by a record from source.
Yes, that is the default configuration.
I think that pg_bulkload will abort if there is duplicated records in this configuration like below.
$ pg_bulkload sample_csv.ctl
NOTICE: BULK LOAD START
ERROR: query failed: ERROR: could not create unique index "foo_pkey"
DETAIL: Key (a)=(1) is duplicated.
DETAIL: query was: SELECT * FROM pg_bulkload($1)
I have one more question. Will pg_bulkload disable the trigger before loading? I don't want to disable the trigger.
Yes, pg_bulkload does not call triggers.
from pg_bulkload.
Thanks.
We created partitioned table based on month or day.
Based on the process date in source file, trigger will look whether the partitioned was already present, if not, will create a partition and load the data.That's essential from our side.
Any other workaround for this using pg_bulkload.
from pg_bulkload.
Because pg_bulkload does not use triggers, you should prepare data files for each partition tables and load each files into each partition tables by pg_bulkload.
from pg_bulkload.
Thanks
from pg_bulkload.
Related Issues (20)
- installcheck not passed with pg12 pg13 pg14 HOT 10
- Cannot load unquoted CSV data?
- Build Errors Postgresql 14 - master branch HOT 2
- Compile Error in Ubuntu LTS 22.04 HOT 2
- stride - invalid command HOT 6
- new lines in fields HOT 2
- delimiter - extended string syntax
- failed to install HOT 7
- unable to load to citus distributed table
- PostgreSQL 15 support HOT 4
- Cannot Make HOT 4
- update deprecated actoins for github actions
- Make impossible on Ubuntu HOT 6
- Error on Ubuntu
- Extension version pg_bulkload mistake HOT 6
- rpmbuild issue and question
- what is recovery command's major purpose ?
- pg_bulkload on PG13 fails to handle large data duplicates HOT 8
- missing img in the doc
- PostgreSQL 16 support HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pg_bulkload.