Re: pltcl bug in 7.2?
От | Darren Ferguson |
---|---|
Тема | Re: pltcl bug in 7.2? |
Дата | |
Msg-id | Pine.LNX.4.10.10204191108001.10473-100000@thread.crystalballinc.com обсуждение исходный текст |
Ответ на | Re: pltcl bug in 7.2? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: pltcl bug in 7.2?
|
Список | pgsql-general |
array get NEW seems to work fine in 7.2.1 This trigger function below works fine CREATE OR REPLACE FUNCTION networks_sort_trigger_func() RETURNS OPAQUE AS ' set sort "0/" if { [info exists NEW(parent_id)] && $NEW(parent_id) != "" } { spi_exec "SELECT sp_go_up_network_tree($NEW(parent_id)) AS parent_list" for { set x [expr [llength $parent_list] - 1] } { $x >= 0 } { incr x -1 } { append sort "[lindex $parent_list $x]/" } } append sort "$NEW(network_id)/" spi_exec "UPDATE inv_network SET sort = ''$sort'' WHERE network_id = $NEW(network_id)" return [array get NEW] END;' LANGUAGE 'pltcl'; DROP TRIGGER networks_sort_trigger ON inv_network; CREATE TRIGGER networks_sort_trigger AFTER INSERT ON inv_network FOR EACH ROW EXECUTE PROCEDURE networks_sort_trigger_func(); But it does not use UTF-8 Darren Ferguson On Fri, 19 Apr 2002, Tom Lane wrote: > Yury Don <yura@vpcit.ru> writes: > > Hello All, > > We have a database with koi8-r encoding, tables and fields names > > mostly in russian, and we have a trigger function on pltcl. With postgresql 7.1 everything > > worked well, but in 7.2 we are getting an error "utf_to_local: could > > not convert UTF-8" in the following construction > > foreach field [array names NEW] { > > if {[info exists OLD(${field})]} .... > > Hmm. Someone added code in 7.2 to support conversion between the > database's encoding (whatever you specified with -E) and the UTF-8 > encoding that Tcl wants to use all the time. Sounds like you've > found a bug in that code. > > > Also this error occures in any calling of NEW or OLD, for example > > [array get NEW] also raises those error. > > Do you see it *only* in references to NEW/OLD? Can you pass the > same data in normal parameters to a Tcl function? > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >
В списке pgsql-general по дате отправления: