pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Bill Studenmund <wrstuden@netbsd.org>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: RFD: schemas and different kinds of Postgres objects
Date: Fri, 25 Jan 2002 00:40:18 -0500
Message-ID: <23721.1011937218@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.30.0201250013040.686-100000@peter.localdomain>
References: <Pine.LNX.4.30.0201250013040.686-100000@peter.localdomain>

Peter Eisentraut <peter_e@gmx.net> writes:
> Here's a tricky question:  In what situations is a.b valid to mean b(a)?

I defined that in my first message on these issues: the last element
of a dotted-name string can be either a field name or a function
(which is applied to a table that's the next-to-last item).  The
next-to-last element is always a table name.

> Because in a general object-like system you could write a.b.c.d to mean
> d(c(b(a))).

Indeed, that can happen now in Postgres, and as I pointed out we have
to get rid of it.  That doesn't mean we need to eliminate the base case,
however.

> Somehow we need to do at least one of three things:
> 1. Require parentheses after function calls.

Breaks existing code unnecessarily.

> 2. Use a different operator to invoke function calls (SQL uses ->).

Breaks existing code unnecessarily.

> 3. Require users to register functions as "methods" with the data type
> before being able to say a.b for b(a).  This also takes care of having to
> specify the schema of b because that's declared when you define the
> method.

Doesn't buy you anything unless you intend to reject function
overloading too.  With overloading you may have multiple functions
b(something), so you still have to be able to determine what a is
without any context.

			regards, tom lane



view thread (103+ messages)  latest in thread

Message-ID: <23721.1011937218@sss.pgh.pa.us>
Permalink:  ../23721.1011937218@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23721.1011937218@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, wrstuden@netbsd.org
  Subject: Re: RFD: schemas and different kinds of Postgres objects
  In-Reply-To: <23721.1011937218@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox