When / how are default value expression functions bound with regard to search_path?

后端 未结 3 1484
盖世英雄少女心
盖世英雄少女心 2021-01-25 16:06

For testing purposes, I provide my own implementation of the now() function which is public.now(). Using search_path to override the defau

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-25 16:24

    Don't bother all that. Postgres sometimes is writing weired stuff after things are compiled. Especially Views are often changed beyound recognition.

    And: now() and pg_catalog.now() is normally the very same. See:

    CREATE OR REPLACE FUNCTION now()
        RETURNS timestamp with time zone AS
    'now'
        LANGUAGE internal STABLE STRICT
     COST 1;
     ALTER FUNCTION now()
        OWNER TO postgres;
     COMMENT ON FUNCTION now() IS 'current transaction time';
    

    Don't worry.

提交回复
热议问题