

 Hi,

I have a question... How PG parser select (build-in) function?
Check parser function's arguments datetypes only or check returns value 
datetype too (for function searching in system cache ..etc)?

I have function to_number(text, text) this function returns numeric 
datetype. Is possible (effective) write this function for more 
datatypes than for numeric? The function is always "to_number(text, text)",
possible difference is in a returned datetype. 

(The function extract number from formated string and this number 
return, but how datetype we want return?)

							Karel

PS. Sorry if my problem description is a litle mazy..

----------------------------------------------------------------------
Karel Zak <zakkr@zf.jcu.cz>              http://home.zf.jcu.cz/~zakkr/

Docs:        http://docs.linux.cz                    (big docs archive)	
Kim Project: http://home.zf.jcu.cz/~zakkr/kim/        (process manager)
FTP:         ftp://ftp2.zf.jcu.cz/users/zakkr/        (C/ncurses/PgSQL)
-----------------------------------------------------------------------


Thu, 13 Jan 2000 16:24:42 +0100 (CET)
Karel Zak - Zakkr <zakkr@zf.jcu.cz>
How PG parser search (build-in) function?
Karel Zak - Zakkr <zakkr@zf.jcu.cz> writes:
> I have a question... How PG parser select (build-in) function?
> Check parser function's arguments datetypes only or check returns value 
> datetype too (for function searching in system cache ..etc)?

The argument types have to be different.  In general, the parser
doesn't *know* what the return type of the function is; it has to
discover that by looking up the function.  So you can't have two
functions of the same name unless they differ in number and/or type
of arguments.

			regards, tom lane

Thu, 13 Jan 2000 10:50:07 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] How PG parser search (build-in) function? 

On Thu, 13 Jan 2000, Tom Lane wrote:

> Karel Zak - Zakkr <zakkr@zf.jcu.cz> writes:
> > I have a question... How PG parser select (build-in) function?
> > Check parser function's arguments datetypes only or check returns value 
> > datetype too (for function searching in system cache ..etc)?
> 
> The argument types have to be different.  In general, the parser
> doesn't *know* what the return type of the function is; it has to
> discover that by looking up the function.  So you can't have two
> functions of the same name unless they differ in number and/or type
> of arguments.

 Well, we must use the numeric version of to_number() only and parser 
must cast from numeric itself (but IMHO it is not effective convert in 
to_number() string to numeric and in parser convert numeric to other
datetype. But if it not possible.. :-(

 Thank!

						Karel


Thu, 13 Jan 2000 17:04:28 +0100 (CET)
Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Re: [HACKERS] How PG parser search (build-in) function? 