Pb with the French accentuated characters
Pb with the French accentuated characters
am 30.04.2002 14:51:55 von frederic massot
Hello,
Since the update of a PC of test (Debian GNU/Linux Woody, Apache
1.3.23-1, Php4 4.1.2, Postgresql 7.2.1), the Web sites functioning on
this PC produce errors during the insertion of French accentuated
characters ("é", "è", "à", etc...) in the databases.
An error message with PHP :
PostgreSQL query failed: ERROR: Invalid UNICODE character sequence
found (0xe97373)
Error messages with psql :
juliana=> insert into essai values ('était');
ERROR: Invalid UNICODE character sequence found (0xe97461)
juliana=> insert into essai values ('ètait');
ERROR: Invalid UNICODE character sequence found (0xe87461)
juliana=> insert into essai values ('àtait');
ERROR: Invalid UNICODE character sequence found (0xe07461)
With version 7.1.3 of Postgresql not did not have any errors.
All the databases are encoding in UNICODE.
Postgresql is compiled with the option "--enable-unicode-conversion".
I know that version 7.2.1 of Postgresql checks the data before inserting
them. But I do not understand why conversion does not function.
Do you have an idea ?
Thank you.
--
==============================================
| FREDERIC MASSOT |
| http://www.juliana-multimedia.com |
| mailto:frederic@juliana-multimedia.com |
===========================Debian=GNU/Linux===
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Re: Pb with the French accentuated characters
am 30.04.2002 15:22:44 von Jean-Michel POURE
Le Mardi 30 Avril 2002 14:51, frederic massot a =E9crit :
> Since the update of a PC of test (Debian GNU/Linux Woody, Apache
> 1.3.23-1, Php4 4.1.2, Postgresql 7.2.1), the Web sites functioning on
> this PC produce errors during the insertion of French accentuated
> characters ("=E9", "=E8", "=E0", etc...) in the databases.
> An error message with PHP :
> PostgreSQL query failed: ERROR: Invalid UNICODE character sequence
> found (0xe97373)
So I presume your database is Unicode.
> Error messages with psql :
> juliana=3D> insert into essai values ('=E9tait');
> ERROR: Invalid UNICODE character sequence found (0xe97461)
> juliana=3D> insert into essai values ('=E8tait');
> ERROR: Invalid UNICODE character sequence found (0xe87461)
> juliana=3D> insert into essai values ('=E0tait');
> ERROR: Invalid UNICODE character sequence found (0xe07461)
Enter:
SET CLIENT_ENCODING =3D 'Latin9'
This will recode backend<->client stream from Unicode to Latin + Euro=20
encoding. If you don't need Euro support, you could also recode to Latin1.
Otherwise, when importing text from a flat file (Latin) into a unicode=20
database (UTF8), recode the file using :
recode ..u8 filename.sql
Cheers,
Jean-Michel POURE
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Re: Pb with the French accentuated characters
am 30.04.2002 15:56:32 von frederic massot
Jean-Michel POURE wrote:
>
>
> Enter:
> SET CLIENT_ENCODING = 'Latin9'
>
> This will recode backend<->client stream from Unicode to Latin + Euro
> encoding. If you don't need Euro support, you could also recode to Latin1.
>
Ok, but for a site allowing the updates of the data for a French users,
or for a Brazilian, with the same interface ?
Sometimes our customers are not French.
Certain parts of the Web site will be updated with French characters,
others with non French characters.
--
==============================================
| FREDERIC MASSOT |
| http://www.juliana-multimedia.com |
| mailto:frederic@juliana-multimedia.com |
===========================Debian=GNU/Linux===
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Re: Pb with the French accentuated characters
am 30.04.2002 16:27:27 von Jean-Michel POURE
Le Mardi 30 Avril 2002 15:56, frederic massot a =E9crit :
> Ok, but for a site allowing the updates of the data for a French users,
> or for a Brazilian, with the same interface ?
> Sometimes our customers are not French.
> Certain parts of the Web site will be updated with French characters,
> others with non French characters.
Latin9 means ISO_8859-15 =3D all Western languages.
This should work for Brazilian.
Otherwise, if you need Arabic + Japanese + French + etc..,
use a complete Unicode chain:
1) Your web pages (.php) should be saved in UTF-8 format.
2) Your web pages (.php) should send UTF-8 headers to the internet browser =
(to=20
tell the browser to switch to UTF-8).
3) PHP should be compiled with mb options enabled.=20
See http://uk.php.net/manual/en/ref.mbstring.php.
Otherwize you wron't be able to calculate string lenght, etc...
mbstring.func_overload should be set to 4 in php.ini to automatically
overload PHP functions with their ITF-8 equivalent.
Have fun,
Jean-Michel POURE
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Re: Pb with the French accentuated characters
am 30.04.2002 18:56:56 von frederic massot
Jean-Michel POURE wrote:
>
>
> So I presume your database is Unicode.
>
> > Error messages with psql :
> > juliana=> insert into essai values ('était');
> > ERROR: Invalid UNICODE character sequence found (0xe97461)
> > juliana=> insert into essai values ('ètait');
> > ERROR: Invalid UNICODE character sequence found (0xe87461)
> > juliana=> insert into essai values ('àtait');
> > ERROR: Invalid UNICODE character sequence found (0xe07461)
>
> Enter:
> SET CLIENT_ENCODING = 'Latin9'
>
> This will recode backend<->client stream from Unicode to Latin + Euro
> encoding. If you don't need Euro support, you could also recode to Latin1.
I have just tested your solutions:
juliana=> select * from essai;
un
----
(0 rows)
juliana=> insert into essai values ('était');
ERROR: Invalid UNICODE character sequence found (0xe97461)
juliana=> SET CLIENT_ENCODING = 'latin9';
SET VARIABLE
juliana=> insert into essai values ('était');
INSERT 225971 1
juliana=> select * from essai;
un
------
tait
(1 row)
juliana=> SET CLIENT_ENCODING = 'latin1';
SET VARIABLE
juliana=> insert into essai values ('était');
INSERT 225972 1
juliana=> select * from essai;
un
------
tait
tait
(2 rows)
There is always a problem with the accents, Arghh !!!
Regards.
--
==============================================
| FREDERIC MASSOT |
| http://www.juliana-multimedia.com |
| mailto:frederic@juliana-multimedia.com |
===========================Debian=GNU/Linux===
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Incompatibility Postgres 7.1 - Postgres 7.3
am 31.05.2002 19:57:16 von Areski Belaid
Someone can help me ....
I have a compatibility problem between Postgres 7.1 - Postgres 7.3...
Guess !!! It's --- timestamptz ---
When I create a field with timestamp type... the new postgresql replace that
by
timestamptz.... I use phpPgAdmin, I don't know where is from the problem...
Simple example, If I execute that :
CREATE TABLE "statistic" (
"Id" int4 NOT NULL,
"DATE" timestamp);
I shall have that on the database:
CREATE TABLE "statistic" (
"Id" int4 NOT NULL,
"DATE" timestamptz);
Grrrrrr, =)
Helpsssssss, Areski
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
DateStyle question
am 31.05.2002 22:12:09 von Sherwin Harris
My question is probably simpler than most of you deal with but:
How do I change the datestyle of my database so that it is in the US style
(or any other style for that matter)?
I want it to start in the new style, not just change it with a SET command.
Any comments or reasons why I should not do this are also welcome.
Sherwin Harris
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
Re: Incompatibility Postgres 7.1 - Postgres 7.3
am 01.06.2002 16:33:15 von Dan Wilson
Postgres has two different timestamp types now. There is "timestamp with
timezone" and "timestamp without timezone". Internally the "with timezone" is
stored as timestamptz. And by default, a timestamp will have a timezone. You
can think of timestamptz as the same as timestamp.
So there is really not a problem here unless you wanted a "timestamp without
timezone". If this is the case, currently phpPgAdmin doesn't provide for the
creation of timestamp without timezone through the table create
functionality. You will have to do it manually through the "Run SQL" box in
the DB Details page.
-Dan
Quoting Areski Belaid :
> Someone can help me ....
>
> I have a compatibility problem between Postgres 7.1 - Postgres 7.3...
> Guess !!! It's --- timestamptz ---
>
> When I create a field with timestamp type... the new postgresql replace that
> by
> timestamptz.... I use phpPgAdmin, I don't know where is from the problem...
>
> Simple example, If I execute that :
> CREATE TABLE "statistic" (
> "Id" int4 NOT NULL,
> "DATE" timestamp);
>
> I shall have that on the database:
> CREATE TABLE "statistic" (
> "Id" int4 NOT NULL,
> "DATE" timestamptz);
>
> Grrrrrr, =)
>
> Helpsssssss, Areski
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
Incompatibility Postgres 7.1 - Postgres 7.2.1
am 04.06.2002 13:16:31 von Areski Belaid
----- Original Message -----
From: "Dan Wilson"
To: "Areski Belaid"
Cc:
Sent: Saturday, June 01, 2002 4:33 PM
Subject: Re: [PHP] Incompatibility Postgres 7.1 - Postgres 7.3
> Postgres has two different timestamp types now. There is "timestamp with
> timezone" and "timestamp without timezone". Internally the "with
timezone" is
> stored as timestamptz. And by default, a timestamp will have a timezone.
You
> can think of timestamptz as the same as timestamp.
>
> So there is really not a problem here unless you wanted a "timestamp
without
> timezone". If this is the case, currently phpPgAdmin doesn't provide for
the
> creation of timestamp without timezone through the table create
> functionality. You will have to do it manually through the "Run SQL" box
in
> the DB Details page.
>
> -Dan
>
> Quoting Areski Belaid :
>
> > Someone can help me ....
> >
> > I have a compatibility problem between Postgres 7.1 - Postgres 7.3...
> > Guess !!! It's --- timestamptz ---
> >
> > When I create a field with timestamp type... the new postgresql replace
that
> > by
> > timestamptz.... I use phpPgAdmin, I don't know where is from the
problem...
> >
> > Simple example, If I execute that :
> > CREATE TABLE "statistic" (
> > "Id" int4 NOT NULL,
> > "DATE" timestamp);
> >
> > I shall have that on the database:
> > CREATE TABLE "statistic" (
> > "Id" int4 NOT NULL,
> > "DATE" timestamptz);
> >
> > Grrrrrr, =)
> >
> > Helpsssssss, Areski
> >
It's working if I introduce the sql command directly in the shell...
CREATE TABLE "statistic" (
"Id" int4 NOT NULL,
"DATE" timestamp without time zone);
One thing good, but I just realize That my problem isn't coming of the time
zone
BUT of the precision...
EXAMPLE:
If I want know the number of day between two date ($lastdate -
$firstdate)...
Value of firstdate = 2002-05-31 12:27:05.121201
Value of lastdate = 2002-06-04 12:29:25.147232
$oneday = 60*60*24*1;
$number_day_between_two_date = intval(( strtotime($lastdate) -
strtotime($firstdate) )/$oneday);
I did that and It' was working without problem before the upgrate of
postgres (Postgres 7.1 - Postgres 7.2.1)
Someone have a idea... What I can do to know the number of day between two
date...
Areski'ch
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Duplicate Database
am 02.08.2002 18:46:01 von Areski Belaid
Hello to everyone,
I have a application using Postgres DB and I going to create a new version
on the same server... I would like duplicate my database with all structure
and data
like that, I can update this new version and keep the last one active
during the release version.
BUT, doesm't work =(
First I create the backup, like that :
pg_dump > db.out
After I try to duplicate this one :
So I create a other user "new-user" and I create a new db "new-db" (new-user
is the owner new-db)
next step :
change 1 ligne on db.out file :
Replace : "\connect - dbname" by "\connect - new-db"
To finish, I try that :
psql new-db< db.out
Of course, it doesn't work, otherwise I won't disturb you =)
Error message:
1: You are now connected as new user new-db
2: ERROR: Relation 'table1' already exists
3: ERROR: Relation 'table1' already exists
4: ...
I tried a lot of think without success, Some helpsssssssss pleaseee.
Thanks to the community, Areski
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
Re: Duplicate Database
am 02.08.2002 19:16:45 von Chris Ruprecht
On Friday 02 August 2002 12:46 pm, Areski Belaid wrote:
> Hello to everyone,
>
> I have a application using Postgres DB and I going to create a new version
> on the same server... I would like duplicate my database with all structu=
re
> and data
> like that, I can update this new version and keep the last one active
> during the release version.
>
> BUT, doesm't work =3D(
>
> First I create the backup, like that :
> pg_dump > db.out
>
>
> After I try to duplicate this one :
>
> So I create a other user "new-user" and I create a new db "new-db"
> (new-user is the owner new-db)
> next step :
> change 1 ligne on db.out file :
> Replace : "\connect - dbname" by "\connect - new-db"
>
> To finish, I try that :
> psql new-db< db.out
try psql -f db.out newdb
run the whole thing as user postgres, that should work.
>
>
>
> Of course, it doesn't work, otherwise I won't disturb you =3D)
>
> Error message:
> 1: You are now connected as new user new-db
> 2: ERROR: Relation 'table1' already exists
> 3: ERROR: Relation 'table1' already exists
> 4: ...
>
>
>
> I tried a lot of think without success, Some helpsssssssss pleaseee.
>
>
>
> Thanks to the community, Areski
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Re: Duplicate Database
am 02.08.2002 19:33:30 von Areski Belaid
I just found and it's working good :
createdb --template=db new-db
=), haaaaaaaaaaa Que bien
On Friday 02 August 2002 12:46 pm, Areski Belaid wrote:
> Hello to everyone,
>
> I have a application using Postgres DB and I going to create a new version
> on the same server... I would like duplicate my database with all
structure
> and data
> like that, I can update this new version and keep the last one active
> during the release version.
>
> BUT, doesm't work =(
>
> First I create the backup, like that :
> pg_dump > db.out
>
>
> After I try to duplicate this one :
>
> So I create a other user "new-user" and I create a new db "new-db"
> (new-user is the owner new-db)
> next step :
> change 1 ligne on db.out file :
> Replace : "\connect - dbname" by "\connect - new-db"
>
> To finish, I try that :
> psql new-db< db.out
try psql -f db.out newdb
run the whole thing as user postgres, that should work.
>
>
>
> Of course, it doesn't work, otherwise I won't disturb you =)
>
> Error message:
> 1: You are now connected as new user new-db
> 2: ERROR: Relation 'table1' already exists
> 3: ERROR: Relation 'table1' already exists
> 4: ...
>
>
>
> I tried a lot of think without success, Some helpsssssssss pleaseee.
>
>
>
> Thanks to the community, Areski
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
The Last Optimization
am 06.09.2002 12:51:27 von Areski Belaid
I have a huge table with 14 field and few million of data...
My application Php/Pg start to be impossible to use.
Redhat 7.3
Dual PIII 900Mhz System
2GB RAM
I did already a some optimization optimization :
max_connections = 64
shared_buffers = 32000
sort_mem = 64336
fsync = false
---
echo 128000000 > /proc/sys/kernel/shmmax
also Vaccum,analyze and Index
---
This optimization was enough at the beginning but NOT now with some
million of instance.
So WHAT I CAN DO ??? USE ORACLE ???
I Think maybe to split my mean table to different table Mean_a Mean_b
.... Mean_z ???
IF it's the way someone where I can find doc or help about howto split
table ???
I M lost !!! ;)
Areski
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
Re: The Last Optimization
am 07.09.2002 07:27:02 von Christopher Kings-Lynne
You'll have to post your complete schema and the actual queries you are
runing that are so slow. Postgres can easily handle such large tables, so
there's probably more improvements you can make to the speed.
Chris
On Fri, 6 Sep 2002, Areski Belaid wrote:
> I have a huge table with 14 field and few million of data...
> My application Php/Pg start to be impossible to use.
>
> Redhat 7.3
> Dual PIII 900Mhz System
> 2GB RAM
>
> I did already a some optimization optimization :
>
> max_connections = 64
> shared_buffers = 32000
> sort_mem = 64336
> fsync = false
> ---
> echo 128000000 > /proc/sys/kernel/shmmax
>
> also Vaccum,analyze and Index
>
> ---
>
> This optimization was enough at the beginning but NOT now with some
> million of instance.
>
> So WHAT I CAN DO ??? USE ORACLE ???
>
> I Think maybe to split my mean table to different table Mean_a Mean_b
> ... Mean_z ???
> IF it's the way someone where I can find doc or help about howto split
> table ???
>
> I M lost !!! ;)
>
>
>
> Areski
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly