Re: [HACKERS] proposal sql: labeled function params

2008-08-25 Thread Pavel Stehule
Hello 2008/8/24 Martijn van Oosterhout <[EMAIL PROTECTED]>: > On Sun, Aug 24, 2008 at 12:00:01PM -0400, Tom Lane wrote: >> So I feel that the proposal for labeled parameters as such is dead >> in the water, and that the only usefulness this thread has had is >> (re-) exploring the syntactic altern

Re: [HACKERS] proposal sql: labeled function params

2008-08-24 Thread Martijn van Oosterhout
On Sun, Aug 24, 2008 at 12:00:01PM -0400, Tom Lane wrote: > So I feel that the proposal for labeled parameters as such is dead > in the water, and that the only usefulness this thread has had is > (re-) exploring the syntactic alternatives available for named params. FWIW, I think the way that pyt

Re: [HACKERS] proposal sql: labeled function params

2008-08-24 Thread Pavel Stehule
2008/8/24 Tom Lane <[EMAIL PROTECTED]>: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> 2008/8/23 Hannu Krosing <[EMAIL PROTECTED]>: >>> Why not just use some standard record syntax, like > >> do you thing, so is it simpler? > > It's not about being "simpler", it's about pointing out that there ar

Re: [HACKERS] proposal sql: labeled function params

2008-08-24 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > 2008/8/23 Hannu Krosing <[EMAIL PROTECTED]>: >> Why not just use some standard record syntax, like > do you thing, so is it simpler? It's not about being "simpler", it's about pointing out that there are ways to do what you need without creating compa

Re: [HACKERS] proposal sql: labeled function params

2008-08-24 Thread Pavel Stehule
Hello 2008/8/24 Hannu Krosing <[EMAIL PROTECTED]>: > On Sun, 2008-08-24 at 08:05 +0200, Pavel Stehule wrote: >> 2008/8/23 Tom Lane <[EMAIL PROTECTED]>: >> > Hannu Krosing <[EMAIL PROTECTED]> writes: >> >> On Sat, 2008-08-23 at 08:21 +0200, Pavel Stehule wrote: >> >>> record or hash table - it's im

Re: [HACKERS] proposal sql: labeled function params

2008-08-24 Thread Hannu Krosing
On Sun, 2008-08-24 at 08:05 +0200, Pavel Stehule wrote: > 2008/8/23 Tom Lane <[EMAIL PROTECTED]>: > > Hannu Krosing <[EMAIL PROTECTED]> writes: > >> On Sat, 2008-08-23 at 08:21 +0200, Pavel Stehule wrote: > >>> record or hash table - it's implementation - second step. We have to > >>> find syntax a

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Pavel Stehule
2008/8/23 Tom Lane <[EMAIL PROTECTED]>: > Hannu Krosing <[EMAIL PROTECTED]> writes: >> On Sat, 2008-08-23 at 08:21 +0200, Pavel Stehule wrote: >>> record or hash table - it's implementation - second step. We have to >>> find syntax and semantic now. > >> Why not just use some standard record syntax

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Pavel Stehule
2008/8/24 daveg <[EMAIL PROTECTED]>: > On Sat, Aug 23, 2008 at 05:08:25PM +0100, Gregory Stark wrote: >> "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> >> > Hello >> > >> > 2008/8/23 Peter Eisentraut <[EMAIL PROTECTED]>: >> >> On Friday 22 August 2008 07:41:30 Decibel! wrote: >> >>> If we're really

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Pavel Stehule
2008/8/23 Hannu Krosing <[EMAIL PROTECTED]>: > On Sat, 2008-08-23 at 08:21 +0200, Pavel Stehule wrote: >> Hello >> >> 2008/8/22 Hannu Krosing <[EMAIL PROTECTED]>: >> > On Thu, 2008-08-21 at 23:41 -0500, Decibel! wrote: >> >> On Aug 20, 2008, at 8:26 AM, Pavel Stehule wrote: >> > >> >> How about we

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread daveg
On Sat, Aug 23, 2008 at 05:08:25PM +0100, Gregory Stark wrote: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: > > > Hello > > > > 2008/8/23 Peter Eisentraut <[EMAIL PROTECTED]>: > >> On Friday 22 August 2008 07:41:30 Decibel! wrote: > >>> If we're really worried about it we can have a GUC for a few

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Tom Lane
Hannu Krosing <[EMAIL PROTECTED]> writes: > On Sat, 2008-08-23 at 08:21 +0200, Pavel Stehule wrote: >> record or hash table - it's implementation - second step. We have to >> find syntax and semantic now. > Why not just use some standard record syntax, like > SELECT(value::type name, ...) Yeah,

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Greg Stark
>> >> At any point in this discussion has anyone explained why these >> labels would >> actually be a good idea? >> > > it's allows smart libraries like SQL/XML You could always just pass the label as an additional parameter. Which is all this would be syntactic sugar for anyways. So it doesn

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Pavel Stehule
> So for a bit of useless syntactic sugar we should introduce conflicts with > named parameters, conflicts with operators, introduce an un-sqlish syntax and > remove a feature users have already made use of and introduce backwards > compatibility issues for those users? > we talk only about "=>" sy

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Pavel Stehule
2008/8/23 Tom Lane <[EMAIL PROTECTED]>: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> I thing, so it's possible - in this case. We should transform named >> params to expr after syntax analyze. > > You're going to have a hard time making parentheses affect the behavior > if you do it that way.

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Hannu Krosing
On Sat, 2008-08-23 at 08:21 +0200, Pavel Stehule wrote: > Hello > > 2008/8/22 Hannu Krosing <[EMAIL PROTECTED]>: > > On Thu, 2008-08-21 at 23:41 -0500, Decibel! wrote: > >> On Aug 20, 2008, at 8:26 AM, Pavel Stehule wrote: > > > >> How about we poll -general and see what people say? I'll bet Tom a

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > I thing, so it's possible - in this case. We should transform named > params to expr after syntax analyze. You're going to have a hard time making parentheses affect the behavior if you do it that way. regards, tom lane -- S

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Gregory Stark
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > Hello > > 2008/8/23 Peter Eisentraut <[EMAIL PROTECTED]>: >> On Friday 22 August 2008 07:41:30 Decibel! wrote: >>> If we're really worried about it we can have a GUC for a few versions >>> that turns off named parameter assignment. But I don't think we

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Pavel Stehule
Hello 2008/8/23 Peter Eisentraut <[EMAIL PROTECTED]>: > On Friday 22 August 2008 07:41:30 Decibel! wrote: >> If we're really worried about it we can have a GUC for a few versions >> that turns off named parameter assignment. But I don't think we >> should compromise the design on the theory that s

Re: [HACKERS] proposal sql: labeled function params

2008-08-23 Thread Peter Eisentraut
On Friday 22 August 2008 07:41:30 Decibel! wrote: > If we're really worried about it we can have a GUC for a few versions   > that turns off named parameter assignment. But I don't think we   > should compromise the design on the theory that some folks might be   > using that as an operator *and* c

Re: [HACKERS] proposal sql: labeled function params

2008-08-22 Thread Pavel Stehule
Hello 2008/8/22 Hannu Krosing <[EMAIL PROTECTED]>: > On Thu, 2008-08-21 at 23:41 -0500, Decibel! wrote: >> On Aug 20, 2008, at 8:26 AM, Pavel Stehule wrote: > >> How about we poll -general and see what people say? I'll bet Tom a >> beer that no one replies saying they've created a => operator (unl

Re: [HACKERS] proposal sql: labeled function params

2008-08-22 Thread Pavel Stehule
Hello 2008/8/22 Teodor Sigaev <[EMAIL PROTECTED]>: >>> How about we poll -general and see what people say? I'll bet Tom a beer >>> that no one replies saying they've created a => operator (unless maybe >>> PostGIS uses it). > > Hstore uses it: > * text => text - creates hstore type from two te

Re: [HACKERS] proposal sql: labeled function params

2008-08-22 Thread Teodor Sigaev
How about we poll -general and see what people say? I'll bet Tom a beer that no one replies saying they've created a => operator (unless maybe PostGIS uses it). Hstore uses it: * text => text - creates hstore type from two text strings select 'a'=>'b'; ?column? -- "a"=>"b" --

Re: [HACKERS] proposal sql: labeled function params

2008-08-22 Thread Hannu Krosing
On Thu, 2008-08-21 at 23:41 -0500, Decibel! wrote: > On Aug 20, 2008, at 8:26 AM, Pavel Stehule wrote: > How about we poll -general and see what people say? I'll bet Tom a > beer that no one replies saying they've created a => operator (unless > maybe PostGIS uses it). Does Oracle use => for

Re: [HACKERS] proposal sql: labeled function params

2008-08-22 Thread Decibel!
On Aug 20, 2008, at 8:26 AM, Pavel Stehule wrote: 2008/8/20 Tom Lane <[EMAIL PROTECTED]>: "Pavel Stehule" <[EMAIL PROTECTED]> writes: I understand now why Oracle use => symbol for named params. This isn't used so operator - so implementation is trivial. You really didn't understand the obje

Re: [HACKERS] proposal sql: labeled function params

2008-08-21 Thread Pavel Stehule
2008/8/21 Asko Oja <[EMAIL PROTECTED]>: > Would AS be harder to implement? > > select foo(10 AS a, 20 AS b); > select foo(20 AS b, 20 AS a); > select x(0 >= 1 AS a); > > other fantasies > select foo(10 a, 20 b); > select foo("a" 10, "b" 20); no, I have it. Problem is in semantic. There are two fea

Re: [HACKERS] proposal sql: labeled function params

2008-08-21 Thread Asko Oja
Would AS be harder to implement? select foo(10 AS a, 20 AS b); select foo(20 AS b, 20 AS a); select x(0 >= 1 AS a); other fantasies select foo(10 a, 20 b); select foo("a" 10, "b" 20); regards, Asko On Wed, Aug 20, 2008 at 4:26 PM, Pavel Stehule <[EMAIL PROTECTED]>wrote: > 2008/8/20 Tom Lane <[

Re: [HACKERS] proposal sql: labeled function params

2008-08-20 Thread Pavel Stehule
2008/8/20 Tom Lane <[EMAIL PROTECTED]>: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> I understand now why Oracle use => symbol for named params. This isn't >> used so operator - so implementation is trivial. > > You really didn't understand the objection at all, did you? > > The point is not ab

Re: [HACKERS] proposal sql: labeled function params

2008-08-20 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > I understand now why Oracle use => symbol for named params. This isn't > used so operator - so implementation is trivial. You really didn't understand the objection at all, did you? The point is not about whether there is any built-in operator named =

Re: [HACKERS] proposal sql: labeled function params

2008-08-20 Thread Pavel Stehule
Hello I understand now why Oracle use => symbol for named params. This isn't used so operator - so implementation is trivial. postgres=# create function x(a boolean) returns bool as $$select $1$$ language sql; CREATE FUNCTION Time: 5,549 ms postgres=# select x(a => true); x --- t (1 row) Time

Re: [HACKERS] proposal sql: labeled function params

2008-08-18 Thread Robert Haas
There may be a TODO in this thread somewhere, but I think this particular suggestion has drifted pretty far from the problem that Pavel was trying to solve. ...Robert On Mon, Aug 18, 2008 at 11:19 AM, Bruce Momjian <[EMAIL PROTECTED]> wrote: > > Is this a TODO? > >> > >> it's not possible in plpg

Re: [HACKERS] proposal sql: labeled function params

2008-08-18 Thread Hannu Krosing
On Mon, 2008-08-18 at 11:19 -0400, Bruce Momjian wrote: > Is this a TODO? I don't think we have a TODO yet. Maybe a TBD :) > --- > > Hannu Krosing wrote: > > On Mon, 2008-08-18 at 08:53 +0200, Pavel Stehule wrote: > > > 200

Re: [HACKERS] proposal sql: labeled function params

2008-08-18 Thread Bruce Momjian
Is this a TODO? --- Hannu Krosing wrote: > On Mon, 2008-08-18 at 08:53 +0200, Pavel Stehule wrote: > > 2008/8/17 Hannu Krosing <[EMAIL PROTECTED]>: > > > On Sun, 2008-08-17 at 17:59 +0200, Pavel Stehule wrote: > > >> Hannu >

Re: [SPAM?]: Re: [HACKERS] proposal sql: labeled function params

2008-08-18 Thread Hannu Krosing
On Mon, 2008-08-18 at 10:51 +0300, Peter Eisentraut wrote: > Am Saturday, 16. August 2008 schrieb Hannu Krosing: > > A "label" is the same thing as "variable"/"attribute"/"argument name" in > > all programming languages I can think of. Why do you need two kinds of > > argument names in postgreSQL

Re: [HACKERS] proposal sql: labeled function params

2008-08-18 Thread Hannu Krosing
On Mon, 2008-08-18 at 08:53 +0200, Pavel Stehule wrote: > 2008/8/17 Hannu Krosing <[EMAIL PROTECTED]>: > > On Sun, 2008-08-17 at 17:59 +0200, Pavel Stehule wrote: > >> Hannu > >> > >> it's not possible in plpgsql, because we are not able iterate via record. > > > > just add function for iterating o

Re: [HACKERS] proposal sql: labeled function params

2008-08-18 Thread Peter Eisentraut
Am Saturday, 16. August 2008 schrieb Hannu Krosing: > A "label" is the same thing as "variable"/"attribute"/"argument name" in > all  programming languages I can think of. Why do you need two kinds of > argument names in postgreSQL ? > > maybe you are after something like keyword arguments in pytho

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Pavel Stehule
2008/8/17 Hannu Krosing <[EMAIL PROTECTED]>: > On Sun, 2008-08-17 at 17:59 +0200, Pavel Stehule wrote: >> Hannu >> >> it's not possible in plpgsql, because we are not able iterate via record. > > just add function for iterating over record :) it's not easy, when iterating should be fast - when rec

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Robert Haas
> uups, completely forgot dual use of = for both assignment and > comparison. > > Maybe we can do without any "keyword arguments" or "labeled function > params" if we define a way to construct records in-place. That sounds a lot cleaner to me. > something like > RECORD( 'Zdanek'::text AS name, 22

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Hannu Krosing
On Sun, 2008-08-17 at 18:24 -0400, Robert Haas wrote: > > Actually the most "natural" syntax to me is just f(name=value) similar > > to how UPDATE does it. It has the added benefit of _not_ forcing us to > > make a operator reserved (AFAIK "=" can't be used to define new ops) > > The problem with

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Robert Haas
> Actually the most "natural" syntax to me is just f(name=value) similar > to how UPDATE does it. It has the added benefit of _not_ forcing us to > make a operator reserved (AFAIK "=" can't be used to define new ops) The problem with this is that SELECT foo(a = b) ...is already valid syntax. It

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Hannu Krosing
On Sun, 2008-08-17 at 17:59 +0200, Pavel Stehule wrote: > Hannu > > it's not possible in plpgsql, because we are not able iterate via record. just add function for iterating over record :) create or replace function json(r record) returns varchar as $$ select '[' || array_to_string( array(

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Pavel Stehule
2008/8/17 Asko Oja <[EMAIL PROTECTED]>: > Not able to means not implementable o not implemented ? Almost not implementable - plpgsql is too static language. > > On Sun, Aug 17, 2008 at 6:59 PM, Pavel Stehule <[EMAIL PROTECTED]> > wrote: >> >> Hannu >> >> it's not possible inNot able to plpgsql,

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Gregory Stark
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > 2008/8/17 Hannu Krosing <[EMAIL PROTECTED]>: >> On Sun, 2008-08-17 at 08:06 +0200, Pavel Stehule wrote: >>> 2008/8/16 Decibel! <[EMAIL PROTECTED]>: >>> > SQL-like would be value AS name, but I'm not a fan of putting the value >>> > before the name. And

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Asko Oja
Not able to means not implementable o not implemented ? On Sun, Aug 17, 2008 at 6:59 PM, Pavel Stehule <[EMAIL PROTECTED]>wrote: > Hannu > > it's not possible inNot able to plpgsql, because we are not able iterate > via record. > > Pavel > > 2008/8/17 Hannu Krosing <[EMAIL PROTECTED]>: > > On Su

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Pavel Stehule
Hannu it's not possible in plpgsql, because we are not able iterate via record. Pavel 2008/8/17 Hannu Krosing <[EMAIL PROTECTED]>: > On Sun, 2008-08-17 at 11:08 -0400, Tom Lane wrote: >> Hannu Krosing <[EMAIL PROTECTED]> writes: >> > Actually the most "natural" syntax to me is just f(name=value)

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Hannu Krosing
On Sun, 2008-08-17 at 11:08 -0400, Tom Lane wrote: > Hannu Krosing <[EMAIL PROTECTED]> writes: > > Actually the most "natural" syntax to me is just f(name=value) similar > > to how UPDATE does it. It has the added benefit of _not_ forcing us to > > make a operator reserved (AFAIK "=" can't be used

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Pavel Stehule
2008/8/17 Hannu Krosing <[EMAIL PROTECTED]>: > On Sun, 2008-08-17 at 08:06 +0200, Pavel Stehule wrote: >> 2008/8/16 Decibel! <[EMAIL PROTECTED]>: >> > On Aug 15, 2008, at 1:20 PM, Hannu Krosing wrote: >> >>> >> >>> "value AS name", on the other hand, accomplishes the same in a more >> >>> SQL-looki

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Tom Lane
Hannu Krosing <[EMAIL PROTECTED]> writes: > Actually the most "natural" syntax to me is just f(name=value) similar > to how UPDATE does it. It has the added benefit of _not_ forcing us to > make a operator reserved (AFAIK "=" can't be used to define new ops) *What* are you thinking?

Re: [HACKERS] proposal sql: labeled function params

2008-08-17 Thread Hannu Krosing
On Sun, 2008-08-17 at 08:06 +0200, Pavel Stehule wrote: > 2008/8/16 Decibel! <[EMAIL PROTECTED]>: > > On Aug 15, 2008, at 1:20 PM, Hannu Krosing wrote: > >>> > >>> "value AS name", on the other hand, accomplishes the same in a more > >>> SQL-looking fashion with no new reserved word (since AS is al

Re: [HACKERS] proposal sql: labeled function params

2008-08-16 Thread Pavel Stehule
2008/8/16 Decibel! <[EMAIL PROTECTED]>: > On Aug 15, 2008, at 1:20 PM, Hannu Krosing wrote: >>> >>> "value AS name", on the other hand, accomplishes the same in a more >>> SQL-looking fashion with no new reserved word (since AS is already >>> fully reserved). >> >> would it be more natural / SQL-li

Re: [HACKERS] proposal sql: labeled function params

2008-08-16 Thread Decibel!
On Aug 15, 2008, at 1:20 PM, Hannu Krosing wrote: "value AS name", on the other hand, accomplishes the same in a more SQL-looking fashion with no new reserved word (since AS is already fully reserved). would it be more natural / SQL-like to use "value AS name" or "name AS value" ? IMHO, *nat

Re: [HACKERS] proposal sql: labeled function params

2008-08-16 Thread Hannu Krosing
On Sat, 2008-08-16 at 08:44 +0200, Pavel Stehule wrote: > Hello > >> "value AS name", on the other hand, accomplishes the same in a more > >> SQL-looking fashion with no new reserved word (since AS is already > >> fully reserved). > > > > would it be more natural / SQL-like to use "value AS name"

Re: [HACKERS] proposal sql: labeled function params

2008-08-16 Thread Peter Eisentraut
On Saturday 16 August 2008 09:38:41 Pavel Stehule wrote: > because you have to write labels, where labels are equal with column > names. I would to add same comfort like SQL/XML functions. Just a thought: You might be able to design this in some way to work on top of named parameter calling. Def

Re: [HACKERS] proposal sql: labeled function params

2008-08-16 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > or just use := operator? You're still commandeering an operator name that wasn't reserved before. This one doesn't even have the feeble excuse of being Oracle-compatible. regards, tom lane -- Sent via pgsql-hackers mailing li

Re: [HACKERS] proposal sql: labeled function params

2008-08-15 Thread Pavel Stehule
Hello 2008/8/15 Hannu Krosing <[EMAIL PROTECTED]>: > On Fri, 2008-08-15 at 10:01 -0400, Tom Lane wrote: >> Peter Eisentraut <[EMAIL PROTECTED]> writes: >> > Random googling shows me that Oracle appears to use a syntax like >> > name => value >> > This is actually a feature that I would like to

Re: [HACKERS] proposal sql: labeled function params

2008-08-15 Thread Pavel Stehule
2008/8/15 Hannu Krosing <[EMAIL PROTECTED]>: > On Fri, 2008-08-15 at 14:54 +0200, Pavel Stehule wrote: >> 2008/8/15 Peter Eisentraut <[EMAIL PROTECTED]>: >> > Am Thursday, 14. August 2008 schrieb Pavel Stehule: >> >> I propose enhance current syntax that allows to specify label for any >> >> functi

Re: [HACKERS] proposal sql: labeled function params

2008-08-15 Thread Hannu Krosing
On Fri, 2008-08-15 at 14:54 +0200, Pavel Stehule wrote: > 2008/8/15 Peter Eisentraut <[EMAIL PROTECTED]>: > > Am Thursday, 14. August 2008 schrieb Pavel Stehule: > >> I propose enhance current syntax that allows to specify label for any > >> function parameter: > >> > >> fcename(expr [as label], ..

Re: [HACKERS] proposal sql: labeled function params

2008-08-15 Thread Hannu Krosing
On Fri, 2008-08-15 at 10:01 -0400, Tom Lane wrote: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > Random googling shows me that Oracle appears to use a syntax like > > name => value > > This is actually a feature that I would like to see implemented soonish, so > > if > > anyone has input

Re: [HACKERS] proposal sql: labeled function params

2008-08-15 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Random googling shows me that Oracle appears to use a syntax like > name => value > This is actually a feature that I would like to see implemented soonish, so > if > anyone has input on the possible syntax consequences, please comment. We've be

Re: [HACKERS] proposal sql: labeled function params

2008-08-15 Thread Pavel Stehule
Hello 2008/8/15 Peter Eisentraut <[EMAIL PROTECTED]>: > Am Friday, 15. August 2008 schrieb Tom Lane: >> Hannu Krosing <[EMAIL PROTECTED]> writes: >> > How is this supposed to interact with argument names ? >> >> Yeah, the real problem with this proposal is that it conscripts a syntax >> that we'll

Re: [HACKERS] proposal sql: labeled function params

2008-08-15 Thread Peter Eisentraut
Am Friday, 15. August 2008 schrieb Tom Lane: > Hannu Krosing <[EMAIL PROTECTED]> writes: > > How is this supposed to interact with argument names ? > > Yeah, the real problem with this proposal is that it conscripts a syntax > that we'll probably want to use in the future for argument-name-based >

Re: [HACKERS] proposal sql: labeled function params

2008-08-15 Thread Pavel Stehule
2008/8/15 Peter Eisentraut <[EMAIL PROTECTED]>: > Am Thursday, 14. August 2008 schrieb Pavel Stehule: >> I propose enhance current syntax that allows to specify label for any >> function parameter: >> >> fcename(expr [as label], ...) >> fcename(colname, ...) >> >> I would to allow same behave of c

Re: [HACKERS] proposal sql: labeled function params

2008-08-15 Thread Peter Eisentraut
Am Thursday, 14. August 2008 schrieb Pavel Stehule: > I propose enhance current syntax that allows to specify label for any > function parameter: > > fcename(expr [as label], ...) > fcename(colname, ...) > > I would to allow  same behave of custom functions like xmlforest function: > postgres=# sel

Re: [HACKERS] proposal sql: labeled function params

2008-08-14 Thread Pavel Stehule
2008/8/15 Tom Lane <[EMAIL PROTECTED]>: > Hannu Krosing <[EMAIL PROTECTED]> writes: >> How is this supposed to interact with argument names ? > > Yeah, the real problem with this proposal is that it conscripts a syntax > that we'll probably want to use in the future for argument-name-based > parame

Re: [HACKERS] proposal sql: labeled function params

2008-08-14 Thread Pavel Stehule
2008/8/14 Hannu Krosing <[EMAIL PROTECTED]>: > On Thu, 2008-08-14 at 11:56 +0200, Pavel Stehule wrote: >> Hello >> >> I propose enhance current syntax that allows to specify label for any >> function parameter: >> >> fcename(expr [as label], ...) >> fcename(colname, ...) > > also fcename(localvar,

Re: [HACKERS] proposal sql: labeled function params

2008-08-14 Thread Tom Lane
Hannu Krosing <[EMAIL PROTECTED]> writes: > How is this supposed to interact with argument names ? Yeah, the real problem with this proposal is that it conscripts a syntax that we'll probably want to use in the future for argument-name-based parameter matching. The proposed behavior is not nearly

Re: [HACKERS] proposal sql: labeled function params

2008-08-14 Thread Hannu Krosing
On Thu, 2008-08-14 at 11:56 +0200, Pavel Stehule wrote: > Hello > > I propose enhance current syntax that allows to specify label for any > function parameter: > > fcename(expr [as label], ...) > fcename(colname, ...) also fcename(localvar, ...) if called from another function ? How is this sup

[HACKERS] proposal sql: labeled function params

2008-08-14 Thread Pavel Stehule
Hello I propose enhance current syntax that allows to specify label for any function parameter: fcename(expr [as label], ...) fcename(colname, ...) I would to allow same behave of custom functions like xmlforest function: postgres=# select xmlforest(a) from foo; xmlforest --- 10 (1 ro