Re: [pgsql-general 2011-1-21:] Are there any projects interested in object functionality? (+ rule bases)

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Nick Rudnick <joerg.rudnick@t-online.de>, Pavel Stehule <pavel.stehule@gmail.com>, pgsql-hackers@postgresql.org
Date: 2011-02-01T15:11:16Z
Lists: pgsql-hackers
On mån, 2011-01-31 at 21:53 -0500, Tom Lane wrote:
> You would probably have better luck shoehorning in such a feature if the
> syntax looked like this:
> 
> 	(foo).bar(baz)
> 
> foo being a value of some type that has methods, and bar being a method
> name.

The SQL standard has the <method invocation> clause that appears to
allow:

    ...something.column.method(args)

Good luck finding out how to interpret the dots, but it's specified
somewhere.

It'd be kind of nice as a syntax and namespacing alternative, actually,
but figuring out the compatibility problems would be a headache.

>   Another possibility is
> 
> 	foo->bar(baz)

This is in the SQL standard under <attribute or method reference>, but
it requires the left side to be of a reference type, which is something
that we don't have.