From: | "Jonathan Ellis" <jellis(at)advocast(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | pltcl: missing close-brace |
Date: | 2000-12-01 00:50:47 |
Message-ID: | 005301c05b30$be4318c0$0d00a8c0@dsl.inconnect.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-sql |
I have a pl/tcl function that doesn't work, but the same function in a
plain-vanilla tcl script does. (The function emulates Oracle's "replace"
function.)
The PL/TCL results:
bf2=# create function replace2 (varchar, varchar, varchar) returns varchar
as '
regsub -all {&} "$3" {\\\&} 3
regsub -all {\\[0-9]} "$3" {\\\0} 3
eval "regsub -all \{$2\} \{$1\} \{$3\} rval"
return $rval
' language 'pltcl';
bf2'# bf2'# bf2'# bf2'# bf2'# CREATE
bf2=# select replace2('a b', ' ', 'c');
ERROR: pltcl: missing close-brace
The plain tcl results:
#!/usr/bin/tcl
proc replace { 1 2 3 } {
regsub -all {&} "$3" {\\\&} 3
regsub -all {\\[0-9]} "$3" {\\\0} 3
eval "regsub -all \{$2\} \{$1\} \{$3\} rval"
return $rval
}
puts [replace "a b" " " "c"]
$ ./test.tcl
acb
Any idea what this error message means?
-Jonathan
From | Date | Subject | |
---|---|---|---|
Next Message | The Hermit Hacker | 2000-12-01 00:53:28 | Re: Transaction logging |
Previous Message | Alex Pilosov | 2000-12-01 00:12:35 | Re: Can PostGreSQL handle 100 user database? |
From | Date | Subject | |
---|---|---|---|
Next Message | Mark Hollomon | 2000-12-01 03:07:22 | Re: Re: [SQL] Rules with Conditions: Bug, or Misunderstanding |
Previous Message | Alex Pilosov | 2000-12-01 00:12:35 | Re: Can PostGreSQL handle 100 user database? |