On Wed, Jun 12, 2013 at 06:35:12PM +0100, peter green wrote:
I'm running wanna-build setup with wbpy to insert logs into the
database. Some logs are failling to insert with errors like:
[…]
The majority of logs insert successfully. The issue does not appear
to be random. If I try and pass a log that failed to insert to
wp-inject manually to retry the injection it will fail every time.
Any idea what might be going wrong and how to debug this? I am
using
postgresql 9.1 (rather than the 8.4 used on buildd.debian.org) could
this be the cause of the problem?
a very quick Googling finds this:
http://dba.stackexchange.com/questions/17604/how-do-i-resolve-postgresql-error-could-not-determine-which-collation-to-use-f
If you upgraded to 9.1
I started out with 9.1, unfortunately it seems I didn't have
postgresql-debversion installed at the time I created the db.
I tried re-running the commands in the wanna-build scripts related
to the debversion type manually folllowed by following the
instructions at http://pgxn.org/dist/debversion/ for upgrading from
an "unpackaged" version. Doing so made no difference.
this likely seems to be the problem.
The wanna-build database doesn't use the citext type. I tried
running the instructions from your url but with debversion instead
of citext, it made no difference to the error.
I'm not sure where the citext stuff is coming from, and I haven't
come across the issue in the stackexchange link before either.
The postgresql-debversion extension will work just fine on
PostgreSQL 8.4, 9.0, 9.1 and 9.2 (and 9.3 beta). So long as
you see
# \dT
List of data types
Schema │ Name │ Description
────────┼────────────┼───────────────────────────────
public │ debversion │ Debian package version number
(1 row)
then it's available and (hopefully!) working. The manual installation
of the debversion type will work with all versions of PostgreSQL; the
CREATE EXTENSION mechanism is preferred for newer versions, but has no
meaningful difference other than convenience and tidiness.
One thing you might well need to do is set the table columns from the
text to debversion type. You could do this using
ALTER TABLE t ALTER COLUMN c SET DATA TYPE debversion;
for each column which needs to be using debversion. This does
require the column to be in a text format in order to do the
conversion (or equivalent e.g. varchar).