Re: ERROR: invalid byte sequence from psql - Works perfectly from pgAdmin III query window

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Anoo Sivadasan Pillai *EXTERN*" <aspillai(at)in(dot)rm(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: ERROR: invalid byte sequence from psql - Works perfectly from pgAdmin III query window
Date: 2007-10-01 11:43:16
Message-ID: D960CB61B694CF459DCFB4B0128514C2443841@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Anoo Sivadasan Pillai wrote:
> Why the Fun_ABC1 is created and Fun_ABC12 is raising the
> following error, while run through psql, ( I Could create
> both the functions from PgAdmin III query )
>
> ERROR: invalid byte sequence for encoding "UTF8": 0x93

Because the characters you entered into psql are not
encoded in the character encoding that psql expects.

You probably create the function in psql by executing an
SQL script, right?

From the error message I deduce that psql expects UTF8
characters from you.

You can do two things:
1) change the SQL script to UTF8 before running it
2) change the client encoding in psql before running the
SQL script.
This is done with the SQL command
SET client_encoding='...'

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2007-10-01 12:02:58 Re: Query problem
Previous Message Ben Trewern 2007-10-01 11:28:07 Re: It's time to support GRANT SELECT, UPDATE, ..., ..., ... ON database.* to username