Re: [BUGS] Bug #728: Interactions between bytea and character encoding
Joe Conway wrote: > Bruce Momjian wrote: > >> Does this mean we don't have to esacpe >0x7f when inputting bytea >> anymore? > > > I seem to remember that bytea data was run through the multibute code > for some reason, and I don't recall seeing that changed. ISTM that we > shouldn't force bytea thought multibyte functions at all. > > The UNKNOWNIN patch did address part of the problem, just not all of it. > Previously all 'unknown' data was initially cast as TEXT, and thus was > subject to multibyte character set interpretation. But there was another > execution path that was not dealt with. I'll search the archives for the > thread. > Here's the remaining issue that I remembered; see: http://archives.postgresql.org/pgsql-hackers/2002-04/msg00256.php The gist of this is that when client and server encoding don't match, pg_do_encoding_conversion() gets called, regardless of data type. This is the *wrong thing* to do for BYTEA data, I think. Fixing this, combined with the UNKNOWNIN/OUT fix we did earlier, should eliminate the need to escape the high bit characters when inputting bytea. The only characters which *should* need to be escaped are the ones originally escaped by PQescapeBytea. IMHO of course ;-) Joe Joe ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[BUGS] Bug #730: cannot create functional index
Vadim Grepan ([EMAIL PROTECTED]) reports a bug with a severity of 3 The lower the number the more severe it is. Short Description cannot create functional index Long Description I've tried to create functional index like that: === cut === db=> CREATE INDEX NDX_FNC_TBL_TRAFBYTES__DATE ON tbl_trafbytes (date (date_trunc ('day', trafbytes_date))); ERROR: parser: parse error at or near "(" === cut === Column trafbytes_date define as === cut === trafbytes_date| timestamp without time zone | not null === cut === Does it means that PostgreSQL funcional indexes support only simplest fucntions like lower ()? Sample Code No file was uploaded with this report ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [BUGS] Bug #730: cannot create functional index
On Sun, 4 Aug 2002 [EMAIL PROTECTED] wrote: > Vadim Grepan ([EMAIL PROTECTED]) reports a bug with a severity of 3 > The lower the number the more severe it is. > > Short Description > cannot create functional index > > Long Description > I've tried to create functional index like > that: > === cut === > db=> CREATE INDEX NDX_FNC_TBL_TRAFBYTES__DATE ON tbl_trafbytes (date (date_trunc >('day', trafbytes_date))); > ERROR: parser: parse error at or near "(" > === cut === > > Column trafbytes_date define as > === cut === > trafbytes_date| timestamp without time zone | not null > === cut === > > Does it means that PostgreSQL funcional indexes support only simplest fucntions like >lower ()? Functional indexes must take as arguments one or more columns. You'll need a function that wraps what you're attempting to do and make the index (and where clauses) with that. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster