Re: RFC: Query Planner making a distinction between Cross Database and Cross Schema ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stef <stef(at)chronozon(dot)artofdns(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: RFC: Query Planner making a distinction between Cross Database and Cross Schema ?
Date: 2004-02-13 00:11:56
Message-ID: 25034.1076631116@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stef <stef(at)chronozon(dot)artofdns(dot)com> writes:
> For example, i would expect the following
> to work:

> CREATE OR REPLACE FUNCTION test_autohist() RETURNS trigger
> AS 'BEGIN
> INSERT INTO history.test2 VALUES (new.field1,history.test_hist.nextval(), new.field2, new.field3, new.field4, new.creation_id, new.creation_date, new.creation_id, new.creation_date);

Why would you expect that to work?

The problem is with this bit:
history.test_hist.nextval()
which is a cross-database function reference per the standard SQL syntax
for such things. (If you were in the history database, it wouldn't be
cross-database, but would refer to the nextval() function in the local
test_hist schema.)

I am not sure what you meant here, but I cannot see any need to
introduce a nonstandard syntax to resolve it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-02-13 00:15:22 Re: Transaction aborts on syntax error.
Previous Message Tom Lane 2004-02-13 00:00:25 Re: 7.4 - FK constraint performance