Search Postgresql Archives

Are SQL queries locale dependent?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I recently found out that my app doesn't work in Spain because it creates localized queries like this:

create table t (c1 float8, c2 float8);
insert into t (c1, c2) values (3,14159, 1,4142);

I understand that PostgreSQL obviously can't parse this query. But I'm not sure how to fix this query so that it works under all circumstances.

If the database uses the "C" (or e.g. English or US) locale, then I know that I always have to use the decimal dot ('.') instead of a decimal comma (','), regardless of the locale of the client machine.

But what if the database itself uses a locale which mandates a decimal comma, like Spanish, German, etc.? How do I have to construct the SQL query then?

Martin

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux