Re: RFC: Query Planner making a distinction between Cross Database and Cross Schema ? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: RFC: Query Planner making a distinction between Cross Database and Cross Schema ?
Date
Msg-id 25034.1076631116@sss.pgh.pa.us
Whole thread Raw
In response to RFC: Query Planner making a distinction between Cross Database and Cross Schema ?  (Stef <stef@chronozon.artofdns.com>)
List pgsql-hackers
Stef <stef@chronozon.artofdns.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Transaction aborts on syntax error.
Next
From: "scott.marlowe"
Date:
Subject: Re: RFC: Query Planner making a distinction between Cross