Re: [ADMIN] create function problem

2004-03-19 Thread Tom Lane
"Thomas Leung" <[EMAIL PROTECTED]> writes: > str := to_char($1, ""); > ERROR: Attribute "" not found Double and single quotes are not interchangeable. Here you have written an identifier, not a string literal. You'll need str := to_char($1, ''''); or str := to_char($1

Re: [ADMIN] create function problem

2004-03-19 Thread Stephan Szabo
On Tue, 16 Mar 2004, Thomas Leung wrote: > I want to index my table using the year of the date. So I create the > following function. > > create function to_year(date) returns varchar as ' > declare > str varchar; > begin > str := to_char($1, ""); > return str; > end; > ' languag

[ADMIN] create function problem

2004-03-19 Thread Thomas Leung
I want to index my table using the year of the date. So I create the following function. create function to_year(date) returns varchar as ' declare str varchar; begin str := to_char($1, ""); return str; end; ' language 'plpgsql' with (iscachable, isstrict); But I face the problem as