Shouldn;t this trigger be called?

Started by stanover 6 years ago3 messagesgeneral
Jump to latest
#1stan
stanb@panix.com

I have defined this function:

CREATE FUNCTION fix_customer_types_case()

and this trigger:

CREATE TRIGGER fix_customer_types_case_trig BEFORE INSERT OR UPDATE ON customer
FOR EACH ROW EXECUTE FUNCTION fix_customer_types_case();

and I put a RAISE NOTICE so I cna tell if the function is called. Yet when I
do a :

\copy to bring data into this table, I do not see the notice.

Shouldn't this fucntion be aclled for that?

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

#2stan
stanb@panix.com
In reply to: stan (#1)
Re: Shouldn;t this trigger be called?

On Sun, Sep 15, 2019 at 11:33:09AM -0400, stan wrote:

I have defined this function:

CREATE FUNCTION fix_customer_types_case()

and this trigger:

CREATE TRIGGER fix_customer_types_case_trig BEFORE INSERT OR UPDATE ON customer
FOR EACH ROW EXECUTE FUNCTION fix_customer_types_case();

and I put a RAISE NOTICE so I cna tell if the function is called. Yet when I
do a :

\copy to bring data into this table, I do not see the notice.

Shouldn't this fucntion be aclled for that?

Sorry, found my mistake.

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: stan (#1)
Re: Shouldn;t this trigger be called?

On 9/15/19 8:33 AM, stan wrote:

I have defined this function:

CREATE FUNCTION fix_customer_types_case()

and this trigger:

CREATE TRIGGER fix_customer_types_case_trig BEFORE INSERT OR UPDATE ON customer
FOR EACH ROW EXECUTE FUNCTION fix_customer_types_case();

and I put a RAISE NOTICE so I cna tell if the function is called. Yet when I
do a :

\copy to bring data into this table, I do not see the notice.

What is the actual command you are using?

For more info see:

https://www.postgresql.org/docs/11/sql-copy.html

which is the command that is being used by \copy.

Shouldn't this fucntion be aclled for that?

--
Adrian Klaver
adrian.klaver@aklaver.com