| From: | Dennis Björklund <db(at)zigo(dot)dhs(dot)org> |
|---|---|
| To: | pgsql-patches(at)postgresql(dot)org |
| Subject: | Patch for psql to avoid altering the PGresult strings |
| Date: | 2003-06-21 15:26:42 |
| Message-ID: | Pine.LNX.4.44.0306211621400.25222-200000@zigo.dhs.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-patches |
The mbvalidate() function was called on the PGresult strings, and it
changes the strings (removes unknown characters).
I've change the validation function to one that either returns a new
string when needed or NULL when the string already was validating. The
normal case is to have validating strings so in most cases no new strings
are created.
I have not included changes to avoid sending non validating strings to the
server. It's not clear what is the best way to solve it. Maybe one should
just do a stupid fix for 7.4 and validate the strings like above and just
delete non validating strings. It is possible to solve it in a better way,
but it's more complicated. We have 4 different charsets to think about in
psql. The server, the client, the terminal and the message catalog (the
last two usually matches, but not always). I would prefer to find a good
solution instead of just patching one small problem after another.
--
/Dennis
| Attachment | Content-Type | Size |
|---|---|---|
| psql_validate.patch | text/plain | 5.9 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2003-06-21 19:57:54 | Re: Thread configure flag |
| Previous Message | Peter Eisentraut | 2003-06-21 12:50:15 | Re: Patch to be verbose about being unable to read |