Re: [ADMIN] encoding converting from ascii to unicode (I got it
I finally got it to work. I tested the unicode database with the newer odbc drivers as well. It is working ok as far asp pages now. Dim ascii As Encoding = Encoding.ASCII Dim [unicode] As Encoding = Encoding.Unicode Dim unicodeBytes As Byte() = [unicode].GetBytes(asciiString) sqltounicode = [unicode].GetString(unicodeBytes) This worked in a .net app using ascii (do not specify the encoding on this connection) read and Unicode write (specify Encoding=UNICODE;). Any one know if I will run into any other issues using a unicode database (is sqlascii now). I use zeos for Delphi, and Java I use: static String driver = "org.postgresql.Driver"; static String url = ""> Just want to make sure my .net, asp , java and Delphi stuff will not break switching to Unicode. I am switching because I hope the new odbc drivers work better for us (we have seen IIS crash from time to time, where we did not before switching to postgres). Joel Fradkin Wazagua, Inc. 2520 Trailmate Dr Sarasota, Florida 34243 Tel. 941-753-7111 ext 305 [EMAIL PROTECTED] www.wazagua.com Powered by Wazagua Providing you with the latest Web-based technology & advanced tools. © 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc This email message is for the use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and delete and destroy all copies of the original message, including attachments. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joel Fradkin Sent: Friday, July 01, 2005 8:09 AM To: pgsql-admin@postgresql.org Subject: [ADMIN] encoding converting from ascii to unicode I have been trying to get unicode to work for us (we moved from MSSQL and had to initially use ascii because it would blow up writing the French chars when I built my data base). I have a .net app that reads my tables and does insert statements into a Unicode database. The actual conversion is being done with this code: Dim ascii As Encoding = Encoding.ASCII Dim [unicode] As Encoding = Encoding.Unicode ' Convert the string into a byte[]. Dim asciiBytes As Byte() = ascii.GetBytes(asciiString) ' Perform the conversion from one encoding to the other. Dim unicodeBytes As Byte() = Encoding.Convert(ascii, [unicode], asciiBytes) sqltounicode = [unicode].GetString(unicodeBytes) So read in ascii and have : Dim cnnunicode As New NpgsqlConnection("Server=" + TextBoxunicodeserver.Text + ";Port=5432;User Id=postgres;Password=;Database=" + TextBoxunicodedbname.Text + ";Encoding=UNICODE;") To open up my Unicode connection that I use for writing. If I observe the string using the debugger it looks like French when I read it from the ascii database. If I do not convert it, it gives a byte sequence error, If I run the conversion above the French turns into question marks. I am sorry for asking this so many times, but what do I have to do to get the French to look like French and in the Unicode database. One of my goals is to be able to use the 8.0 odbc drivers which return question marks for French chars (the 7.4 odbc driver does not turn them into question marks it reads the French ascii ok). Any help is much appreciated. Joel Fradkin Wazagua, Inc. 2520 Trailmate Dr Sarasota, Florida 34243 Tel. 941-753-7111 ext 305 [EMAIL PROTECTED] www.wazagua.com Powered by Wazagua Providing you with the latest Web-based technology & advanced tools. © 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc This email message is for the use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and delete and destroy all copies of the original message, including attachments.
[ADMIN] replication for hot-standby?
I need something that is able to replicate schema changes as well, so Slony seems out of the game :/ pg_cluster? mammoth postgresql? db_mirror? What to use for a hot-standby box? Thanks in advance ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [ADMIN] restore database from bare files
>psql: FATAL: IDENT authentication failed for user "ezpublish" This might help, or you may want to check or post your pg_hba.conf. http://archives.postgresql.org/pgsql-sql/2004-03/msg00202.php (or http://www.postgresql.org/docs/7.4/interactive/auth-methods.html#AUTH-IDENT) HTH, Ben Kim / Developer College of Education Texas A&M University ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
[ADMIN] encoding converting from ascii to unicode
I have been trying to get unicode to work for us (we moved from MSSQL and had to initially use ascii because it would blow up writing the French chars when I built my data base). I have a .net app that reads my tables and does insert statements into a Unicode database. The actual conversion is being done with this code: Dim ascii As Encoding = Encoding.ASCII Dim [unicode] As Encoding = Encoding.Unicode ' Convert the string into a byte[]. Dim asciiBytes As Byte() = ascii.GetBytes(asciiString) ' Perform the conversion from one encoding to the other. Dim unicodeBytes As Byte() = Encoding.Convert(ascii, [unicode], asciiBytes) sqltounicode = [unicode].GetString(unicodeBytes) So read in ascii and have : Dim cnnunicode As New NpgsqlConnection("Server=" + TextBoxunicodeserver.Text + ";Port=5432;User Id=postgres;Password=;Database=" + TextBoxunicodedbname.Text + ";Encoding=UNICODE;") To open up my Unicode connection that I use for writing. If I observe the string using the debugger it looks like French when I read it from the ascii database. If I do not convert it, it gives a byte sequence error, If I run the conversion above the French turns into question marks. I am sorry for asking this so many times, but what do I have to do to get the French to look like French and in the Unicode database. One of my goals is to be able to use the 8.0 odbc drivers which return question marks for French chars (the 7.4 odbc driver does not turn them into question marks it reads the French ascii ok). Any help is much appreciated. Joel Fradkin Wazagua, Inc. 2520 Trailmate Dr Sarasota, Florida 34243 Tel. 941-753-7111 ext 305 [EMAIL PROTECTED] www.wazagua.com Powered by Wazagua Providing you with the latest Web-based technology & advanced tools. © 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc This email message is for the use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and delete and destroy all copies of the original message, including attachments.
Re: [ADMIN] restore database from bare files
Ben Kim wrote: ezpublish_db-# ALTER USER ezpublish SET PASSWORD secret; ERROR: syntax error at or near "$" at character 1 I wonder why you have "ezpublish_db-#" instead of "ezpublish_db=#"? I just noticed it, and to me it happens usually when something's been carried over from the previous line. My 2 pence... indeed I typed a comment before without ending it with ";" that might explain the "syntax error" ! for my pb, I have part of an explanation -> I forgot to recreate the user ! so here I go again in one command to create user and set password: $ createuser ezpublish -P Enter password for new user: *** Enter it again: *** Shall the new user be allowed to create databases? (y/n) y Shall the new user be allowed to create more new users? (y/n) n CREATE USER then: $ psql ezpublish_db -U ezpublish -W Password: *** psql: FATAL: IDENT authentication failed for user "ezpublish" I really don't understand :-( If I go with postgres user, no pb: $ psql ezpublish_db -U postgres Welcome to psql 7.4.8, the PostgreSQL interactive terminal. if it can help to debug, here's my users list: ezpublish_db=# select * from pg_user; usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig ---+--+-+--+---+--+--+--- postgres |1 | t | t| t | | | ezpublish | 100 | t | f| f | | | (2 rows) If you have an idea , I'll really apreciate Thanks !. Regards, Ben Kim Developer College of Education Texas A&M University ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]