Search Postgresql Archives

Re: functions - triggers cross schemas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ok that was my oversight in understanding that the path does not change upon entering a function. I assumed that .it does by simply picking it from the schema2.test1 

Thanks a bunch

Armand

On Oct 13, 2016, at 5:31 PM, David G. Johnston <david.g.johnston@xxxxxxxxx> wrote:

On Thu, Oct 13, 2016 at 3:18 PM, Armand Pirvu (home) <armand.pirvu@xxxxxxxxx> wrote:
2 schemas , schema1 and schema2, with same tables , a base table and a tracking one.


Search path is set to schema1 by default.
insert into schema2.test1 (col2 , col3) values ('foo1','foo2')
I get an entry in schema1.test1_hist and not in schema2.test1_hist

​See:


TG_TABLE_SCHEMA

​Any object name not schema qualified will use search_path for resolution.  Search path doesn't change upon entering a function unless the function defines its own - and your's does not.

David J.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux