pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rural Hunter <ruralhunter@gmail.com>
To: raghu ram <raghuchennuru@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: invalid byte sequence for encoding "UTF8": 0xf481 - how could this happen?
Date: Sat, 14 Apr 2012 12:01:08 +0800
Message-ID: <4F88F684.3030405@gmail.com> (raw)
In-Reply-To: <CALnrrJTPzsNvaFP_qHisMS=wwp2bkvK=gk_wPDzC-fdaXEkypA@mail.gmail.com>
References: <4F88DB40.9070609@gmail.com>
	<CALnrrJTPzsNvaFP_qHisMS=wwp2bkvK=gk_wPDzC-fdaXEkypA@mail.gmail.com>

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    doesn't work either.<br>
    <br>
    db=# show client_encoding;<br>
    &nbsp;client_encoding <br>
    -----------------<br>
    &nbsp;UTF8<br>
    (1 row)<br>
    <br>
    db=# set client_encoding='LATIN1';<br>
    SET<br>
    db=# show client_encoding;<br>
    &nbsp;client_encoding <br>
    -----------------<br>
    &nbsp;LATIN1<br>
    (1 row)<br>
    <br>
    db=# select to_tsvector(content) from tmp_article;<br>
    ERROR:&nbsp; invalid byte sequence for encoding "UTF8": 0xf481<br>
    <br>
    &#20110; 2012/4/14 10:15, raghu ram &#20889;&#36947;:
    <blockquote
cite="mid:CALnrrJTPzsNvaFP_qHisMS=wwp2bkvK=gk_wPDzC-fdaXEkypA@mail.gmail.com"
      type="cite"><br>
      <br>
      <div class="gmail_quote">2012/4/14 Rural Hunter <span dir="ltr">&lt;<a
            moz-do-not-send="true" href="mailto:ruralhunter@gmail.com">ruralhunter@gmail.com</a>&gt;</span><br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          My db is in utf-8, I have a row in my table say tmp_article
          and I wanted to generate ts_vector from the article content:<br>
          select to_tsvector(content) from tmp_article;<br>
          But I got this error:<br>
          ERROR: &nbsp;invalid byte sequence for encoding "UTF8": 0xf481<br>
          <br>
          I am wondering how this could happen. I think if there was
          invalid UTF8 bytes in the content, it shouldn't have been able
          to inserted into the tmp_article table as I sometimes see
          similar errors when inserting records to tmp_article. Am I
          right?<span class="HOEnZb"><font color="#888888"><br>
              <br>
            </font></span></blockquote>
        <div><br>
        </div>
        <div>
          <p class="p1">This error can also happen if the <span
              class="s1">byte</span> <span class="s1">sequence</span>
            does not match the <span class="s1">encoding</span>
            expected by the server, which is controlled by
            "client_encoding".</p>
        </div>
        <div>Try to set client_encoding='LATIN1'&nbsp;</div>
        <div><br>
        </div>
        <div>and then execute&nbsp;</div>
      </div>
      <div><br>
      </div>
      select to_tsvector(content) from tmp_article;<br clear="all">
      <div><br>
      </div>
      -- <br>
      <p>Thanks &amp; Regards,</p>
      <p>Raghu Ram</p>
      <p>EnterpriseDB: <a moz-do-not-send="true"
          href="http://www.enterprisedb.com/"; target="_blank"><span>http://www.enterprisedb.com</span></a></p;
      <br>
    </blockquote>
    <br>
  </body>
</html>



view thread (29+ messages)  latest in thread

Message-ID: <4F88F684.3030405@gmail.com>
Permalink:  ../4F88F684.3030405@gmail.com/
Also on:    postgresql.org/message-id/4F88F684.3030405@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ruralhunter@gmail.com, raghuchennuru@gmail.com
  Subject: Re: invalid byte sequence for encoding "UTF8": 0xf481 - how could this happen?
  In-Reply-To: <4F88F684.3030405@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox