Re: Best practice for: ERROR: invalid byte sequence for encoding "UTF8"

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Phoenix Kiula" <phoenix(dot)kiula(at)gmail(dot)com>
Cc: "Ivan Zolotukhin" <ivan(dot)zolotukhin(at)gmail(dot)com>, "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Best practice for: ERROR: invalid byte sequence for encoding "UTF8"
Date: 2007-08-15 17:40:44
Message-ID: dcc563d10708151040i57cb25d6p845bf6364f8b82b0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/15/07, Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com> wrote:
> > What, exactly, does that mean?
> >
> > That PostgreSQL should take things in invalid utf-8 format and just store them?
> > Or that PostgreSQL should autoconvert from invalid utf-8 to valid
> > utf-8, guessing the proper codes?
> >
> > Seriously, what do you want pgsql to do with these invalid inputs?
>
>
> PG should let me, as the administrator of the database, decide whether
> I mind my DB to have an option to:
>
> 1. Either allow the "invalid" input
>
> 2. Or to continue storing the other information in the table even if
> an exception was thrown for the utf-8 column (which may be an
> unrequired column, for instance, so I may want it not to block the
> storage of other valid input which is more important)
>
> I am not advocating what others should do. But I know what I need my
> DB to do. If I want it to store data that does not match puritanical
> standards of textual storage, then it should allow me to...
>
> It's just a wishlist item from me, but I realize my voice may be
> inconsequential.

Can't you just create your db as SQL_ASCII and let it store anything
then? I mean if you create a database in UTF-8 you're asking it to
carefully check the input. If you set it to SQL_ASCII, you're telling
it to store anything.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-08-15 17:42:28 Re: pg_dump on local Windows, pg_restore on Linux?
Previous Message Phoenix Kiula 2007-08-15 17:37:23 Re: Best practice for: ERROR: invalid byte sequence for encoding "UTF8"