Re: [GENERAL] Variadic polymorpic functions

2010-01-27 Thread Vincenzo Romano
2010/1/27 Tom Lane : > Vincenzo Romano writes: >> But why still on  separate schema? >> I'd rather put them all in the public one, so you don't need the "pst." >> anymore. >> Just like (most of) all other contrib modules ... > > If this were to get committed, it would definitely get made to look

Re: [GENERAL] Variadic polymorpic functions

2010-01-27 Thread Pavel Stehule
2010/1/27 Tom Lane : > Vincenzo Romano writes: >> But why still on  separate schema? >> I'd rather put them all in the public one, so you don't need the "pst." >> anymore. >> Just like (most of) all other contrib mudules ... > > If this were to get committed, it would definitely get made to look

Re: [GENERAL] Variadic polymorpic functions

2010-01-27 Thread Vincenzo Romano
2010/1/27 Pavel Stehule : > 2010/1/27 Vincenzo Romano : >> But why still on  separate schema? >> I'd rather put them all in the public one, so you don't need the "pst." >> anymore. >> Just like (most of) all other contrib mudules ... > > if you like, you can set a search_path > > it is cleaner tha

Re: [GENERAL] Variadic polymorpic functions

2010-01-27 Thread Tom Lane
Vincenzo Romano writes: > But why still on separate schema? > I'd rather put them all in the public one, so you don't need the "pst." > anymore. > Just like (most of) all other contrib mudules ... If this were to get committed, it would definitely get made to look just like all the other contri

Re: [GENERAL] Variadic polymorpic functions

2010-01-27 Thread Pavel Stehule
2010/1/27 Vincenzo Romano : > 2010/1/27 Pavel Stehule : >> Hello >> >> I add sprintf function. Now I think, we can add new contrib module >> (string functions) with both function - format and sprintf. These >> functions are relative different, so they can exists separately. >> Format is simpler and

Re: [GENERAL] Variadic polymorpic functions

2010-01-27 Thread Vincenzo Romano
2010/1/27 Pavel Stehule : > Hello > > I add sprintf function. Now I think, we can add new contrib module > (string functions) with both function - format and sprintf. These > functions are relative different, so they can exists separately. > Format is simpler and faster. Sprintf is more powerful bu

Re: [GENERAL] Variadic polymorpic functions

2010-01-27 Thread Pavel Stehule
Hello I add sprintf function. Now I think, we can add new contrib module (string functions) with both function - format and sprintf. These functions are relative different, so they can exists separately. Format is simpler and faster. Sprintf is more powerful but slower. postgres=# select pst.form

Re: [GENERAL] Variadic polymorpic functions

2010-01-25 Thread Pavel Stehule
2010/1/25 Vincenzo Romano : > 2010/1/25 Pavel Stehule : >> 2010/1/25 Vincenzo Romano : >>> 2010/1/23 Pavel Stehule : 2010/1/22 Vincenzo Romano : > 2010/1/22 Tom Lane : >> Vincenzo Romano writes: >>> 2010/1/22 Tom Lane : regression=# CREATE FUNCTION q( fmt text, variadic a

Re: [GENERAL] Variadic polymorpic functions

2010-01-25 Thread Vincenzo Romano
2010/1/25 Pavel Stehule : > 2010/1/25 Vincenzo Romano : >> 2010/1/23 Pavel Stehule : >>> 2010/1/22 Vincenzo Romano : 2010/1/22 Tom Lane : > Vincenzo Romano writes: >> 2010/1/22 Tom Lane : >>> regression=# CREATE FUNCTION q( fmt text, variadic args "any" ) > >> And this wou

Re: [GENERAL] Variadic polymorpic functions

2010-01-24 Thread Pavel Stehule
2010/1/25 Vincenzo Romano : > 2010/1/25 Pavel Stehule : >> 2010/1/25 Vincenzo Romano : >>> 2010/1/23 Pavel Stehule : 2010/1/22 Vincenzo Romano : > 2010/1/22 Tom Lane : >> Vincenzo Romano writes: >>> 2010/1/22 Tom Lane : regression=# CREATE FUNCTION q( fmt text, variadic a

Re: [GENERAL] Variadic polymorpic functions

2010-01-24 Thread Vincenzo Romano
2010/1/25 Pavel Stehule : > 2010/1/25 Vincenzo Romano : >> 2010/1/23 Pavel Stehule : >>> 2010/1/22 Vincenzo Romano : 2010/1/22 Tom Lane : > Vincenzo Romano writes: >> 2010/1/22 Tom Lane : >>> regression=# CREATE FUNCTION q( fmt text, variadic args "any" ) > >> And this wou

Re: [GENERAL] Variadic polymorpic functions

2010-01-24 Thread Pavel Stehule
2010/1/25 Vincenzo Romano : > 2010/1/23 Pavel Stehule : >> 2010/1/22 Vincenzo Romano : >>> 2010/1/22 Tom Lane : Vincenzo Romano writes: > 2010/1/22 Tom Lane : >> regression=# CREATE FUNCTION q( fmt text, variadic args "any" ) > And this would allow for a stdarg-like argument

Re: [GENERAL] Variadic polymorpic functions

2010-01-24 Thread Vincenzo Romano
2010/1/23 Pavel Stehule : > 2010/1/22 Vincenzo Romano : >> 2010/1/22 Tom Lane : >>> Vincenzo Romano writes: 2010/1/22 Tom Lane : > regression=# CREATE FUNCTION q( fmt text, variadic args "any" ) >>> And this would allow for a stdarg-like argument list? >>> >>> Yeah, it should work, g

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Pavel Stehule
2010/1/22 Vincenzo Romano : > 2010/1/22 Tom Lane : >> Vincenzo Romano writes: >>> 2010/1/22 Tom Lane : regression=# CREATE FUNCTION q( fmt text, variadic args "any" ) >> >>> And this would allow for a stdarg-like argument list? >> >> Yeah, it should work, given suitable C code. > > Great! >

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Vincenzo Romano
2010/1/22 Tom Lane : > Vincenzo Romano writes: >> 2010/1/22 Tom Lane : >>> regression=# CREATE FUNCTION q( fmt text, variadic args "any" ) > >> And this would allow for a stdarg-like argument list? > > Yeah, it should work, given suitable C code. Great! -- Vincenzo Romano NotOrAnd Information T

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Tom Lane
Vincenzo Romano writes: > 2010/1/22 Tom Lane : >> regression=# CREATE FUNCTION q( fmt text, variadic args "any" ) > And this would allow for a stdarg-like argument list? Yeah, it should work, given suitable C code. regards, tom lane -- Sent via pgsql-general mailing li

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Vincenzo Romano
2010/1/22 Tom Lane : > Vincenzo Romano writes: >>> I think "variadic any" is exactly it, but too lazy to go look. > >> I fear there's no way! > >> tmp1=# CREATE FUNCTION q( fmt text, variadic args any ) > > More like this: > > regression=# CREATE FUNCTION q( fmt text, variadic args "any" ) > regre

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Tom Lane
Vincenzo Romano writes: >> I think "variadic any" is exactly it, but too lazy to go look. > I fear there's no way! > tmp1=# CREATE FUNCTION q( fmt text, variadic args any ) More like this: regression=# CREATE FUNCTION q( fmt text, variadic args "any" ) regression-# RETURNS void regression-# LA

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Vincenzo Romano
2010/1/22 Tom Lane : > Vincenzo Romano writes: >> 2010/1/22 Tom Lane : >>> Vincenzo Romano writes: So there's no way to have a function accepting a VARIADIC ANY. Right? >>> >>> Not in PL functions.  You can do it in C if you're desperate (but you >>> then have to deal with each argument indi

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Tom Lane
Vincenzo Romano writes: > 2010/1/22 Tom Lane : >> Vincenzo Romano writes: >>> So there's no way to have a function accepting a VARIADIC ANY. Right? >> >> Not in PL functions.  You can do it in C if you're desperate (but you >> then have to deal with each argument individually --- they're not for

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Vincenzo Romano
2010/1/22 Tom Lane : > Vincenzo Romano writes: >> So there's no way to have a function accepting a VARIADIC ANY. Right? > > Not in PL functions.  You can do it in C if you're desperate (but you > then have to deal with each argument individually --- they're not formed > into an array). How would

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Tom Lane
Vincenzo Romano writes: > So there's no way to have a function accepting a VARIADIC ANY. Right? Not in PL functions. You can do it in C if you're desperate (but you then have to deal with each argument individually --- they're not formed into an array). regards, tom lane

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Vincenzo Romano
2010/1/22 Tom Lane : > Vincenzo Romano writes: >> I'm using the printf() function as seen here: >> http://wiki.postgresql.org/wiki/Sprintf > > ... which is "variadic anyarray". > >> I was expecting that a "variadic polymorphic" function was able to >> accept a "variable number of arguments of diff

Re: [GENERAL] Variadic polymorpic functions

2010-01-22 Thread Tom Lane
Vincenzo Romano writes: > I'm using the printf() function as seen here: > http://wiki.postgresql.org/wiki/Sprintf ... which is "variadic anyarray". > I was expecting that a "variadic polymorphic" function was able to > accept a "variable number of arguments of different types" (a-la C), > while

[GENERAL] Variadic polymorpic functions

2010-01-22 Thread Vincenzo Romano
Hi all. I'm using the printf() function as seen here: http://wiki.postgresql.org/wiki/Sprintf What I see is that when I call that function with just 1 argument, it's always OK. As here: -- code mp1=# SELECT printf( '%',now() ); printf --- 2010-01-22 18:31: