chandresh rana wrote:
Hi Richard, I have eliminated certain tables while exporting as they the size of the data in the tables are huge.Am having the schema of all the tables. Now want to import certain set of records/rows from the eliminated tables. Is it possible to do that ?? If yes, then can you please tell me how I can accomplish this?
The only practical way would be to process the rows outside the database, perhaps in a Perl script or similar. Pipe COPY-format data dumps through your script and have it strip out unwanted lines as it feeds them to psql.
Otherwise, you'll have to import all the rows and then delete the ones you want.
How postgresql take care of all the constraints/referential integrity while importing the records from the different tables?
It won't do anything different with a standard COPY vs inserting rows normally. You'll probably want to turn off constraints and indexes and then re-apply them after the import.
Is there a good reason why you're not using pg_dump/pg_restore for this? -- Richard Huxton Archonet Ltd