Assuming the default
postgresql.conf as shipped with Ubuntu's PostgreSQL package, a plausible reason for these huge log files would be that your data import would generate tons on warnings like this:
2012-06-11 14:00:01 CEST WARNING: nonstandard use of \ in a string literal at character 25
2012-06-11 14:00:01 CEST HINT: Use the escape string syntax for backslashes, e.g., E'\'.
sudo more /var/log/postgresql/postgresql-8.4-main.log to check the actual contents of the latest log file.
If these warnings are the reason why the log files are huge, they can be muted by setting
escape_string_warning to OFF in
See the compatibility notes in postgresql 8.4 docs for why this warning kicks in.
The other default logging settings of PostgreSQL on Ubuntu are:
These are sane values that should not produce log overflow.
The log rotation is handled by logrotate and configured in
By default, it's:
Should you want to reduce the number of log files or accelerate their deletion, this is the file to modify. But it would better to identify and suppress the root cause of these huge logs.