Link to home
Start Free TrialLog in
Avatar of hi4ppl
hi4ppl

asked on

How to load multiple files with copy from in postgress

Hi,

im in windows enviroment and I want to load multiple files from a location to database.. the one file is easy but multiple files how can you do it?

and secondly there are some value is missing from a some files i.e
name|fname|DOB
jack | bill |1985
bill|jack

in above case the DOB of bill is not present and it though an error how can I load other data and ignore one field that data is not their...

PostgreSQL version is 9.1

thanks for help
SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of earth man2
earth man2
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hi4ppl
hi4ppl

ASKER

Hi thanks for the help, but my second point was that if the data is missing on one column the copy is not going though it gives me following error.

ERROR:  missing data for column "DOB"

Open in new window


so how can I ignore any field that does not have data... so it load null data when any field don't have data on it.

thanks for your time
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can also add default value for table column...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial