Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

libpq + utf-8



I met problems using libpq API with utf-8 database.
I can't figure out how to use, for example, function PQexec. This function has two parameters: PQexec(PGconn *conn, const char *command);
If the command is, for example:
  INSERT INTO mytable (column1,column2,column3) VALUES ('non-English text 1','non-English text 2','non-English text 3')
what format the string command[] should have? Should it be UTF-8, UTF-16 or ANSI(??) string?

When I use INSERT command with English data I can use ANSI string as command[] parameter and everything works fine, but when I try to INSERT, for example, Russian text into table columns, I fail using both UTF-8 and Windows1251 encoding in command[].


  Sincerely, Konstantin S. Lokhtin,
  mailto:lokhtin(at)irkutsk(dot)bnk(dot)ru, ICQ: 233336237







Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group