Thread

  1. Re: trigger question.

    shreedhar <shreedhar@lucidindia.net> — 2003-03-11T05:06:36Z

    You can drop and create triggers with the following commands.
    
     DROP TRIGGER TriggerName ON TableName;
    CREATE TRIGGER TriggerName AFTER/BEFORE  INSERT/DELETE/UPDATE ON TableName
    FOR EACH ROW EXECUTE PROCEDURE ProcedureName;
    
    Sreedhar
    ----- Original Message -----
    From: <alain.bruneau@acoss.fr>
    To: <pgsql-general@postgresql.org>
    Sent: Tuesday, March 25, 2003 9:31 PM
    Subject: [GENERAL] trigger question.
    
    
    > Hi.
    > Has anyone migrated from Oracle to Postgresql there ?
    >
    > I have a problem with trigger. I don't find a way to disable it.
    > Oracle statement :
    > ALTER TRIGGER "TRG_DT_ACTI"  ENABLE
    > or
    > ALTER TRIGGER "TRG_DT_ACTI"  DISABLE
    > I am looking for a way to do the same thing with postgresql.
    >
    > I want to disable trigger before COPY and enable it after.
    > How can I do that?
    >
    > Thank you for your help.
    >
    > Regards,
    > Alain.
    >
    >
    > ---------------------------(end of broadcast)---------------------------
    > TIP 2: you can get off all lists at once with the unregister command
    >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
    
    
    
  2. trigger question.

    alain.bruneau@acoss.fr — 2003-03-25T16:01:58Z

    Hi.
    Has anyone migrated from Oracle to Postgresql there ?
    
    I have a problem with trigger. I don't find a way to disable it.
    Oracle statement :
    ALTER TRIGGER "TRG_DT_ACTI"  ENABLE
    or
    ALTER TRIGGER "TRG_DT_ACTI"  DISABLE
    I am looking for a way to do the same thing with postgresql.
    
    I want to disable trigger before COPY and enable it after.
    How can I do that?
    
    Thank you for your help.
    
    Regards,
    Alain.
    
    
    
  3. Re: trigger question.

    Shridhar Daithankar <shridhar_daithankar@persistent.co.in> — 2003-03-25T16:16:27Z

    On Tuesday 25 Mar 2003 9:31 pm, alain.bruneau@acoss.fr wrote:
    > I have a problem with trigger. I don't find a way to disable it.
    > Oracle statement :
    > ALTER TRIGGER "TRG_DT_ACTI"  ENABLE
    > or
    > ALTER TRIGGER "TRG_DT_ACTI"  DISABLE
    > I am looking for a way to do the same thing with postgresql.
    >
    > I want to disable trigger before COPY and enable it after.
    > How can I do that?
    
    Drop and recreate respectively.
    
    HTH
    
     Shridhar
    
    
    
  4. Re: trigger question.

    Dennis Gearon <gearond@cvc.net> — 2003-03-25T16:25:05Z

    As a follow up, I would read the  trigger into a file first, so that you can 
    restore it. Also, watch single quotes and the semicolon at the end of the 
    trigger definition. It may not show up correctly in the structure readout of the 
      trigger.
    
    And, you don't need to drop the functions that the trigger references, just the 
    trigger.
    
    Shridhar Daithankar wrote:
    > On Tuesday 25 Mar 2003 9:31 pm, alain.bruneau@acoss.fr wrote:
    > 
    >>I have a problem with trigger. I don't find a way to disable it.
    >>Oracle statement :
    >>ALTER TRIGGER "TRG_DT_ACTI"  ENABLE
    >>or
    >>ALTER TRIGGER "TRG_DT_ACTI"  DISABLE
    >>I am looking for a way to do the same thing with postgresql.
    >>
    >>I want to disable trigger before COPY and enable it after.
    >>How can I do that?
    > 
    > 
    > Drop and recreate respectively.
    > 
    > HTH
    > 
    >  Shridhar
    > 
    > 
    > ---------------------------(end of broadcast)---------------------------
    > TIP 3: if posting/reading through Usenet, please send an appropriate
    > subscribe-nomail command to majordomo@postgresql.org so that your
    > message can get through to the mailing list cleanly
    > 
    
    
    
  5. Re: trigger question.

    Jean-Luc Lachance <jllachan@nsd.ca> — 2003-03-25T20:27:53Z

    Have you looked at the output of "pg_dump -at" lately?
    
    JL
    
    Dennis Gearon wrote:
    > 
    > As a follow up, I would read the  trigger into a file first, so that you can
    > restore it. Also, watch single quotes and the semicolon at the end of the
    > trigger definition. It may not show up correctly in the structure readout of the
    >   trigger.
    > 
    > And, you don't need to drop the functions that the trigger references, just the
    > trigger.
    > 
    > Shridhar Daithankar wrote:
    > > On Tuesday 25 Mar 2003 9:31 pm, alain.bruneau@acoss.fr wrote:
    > >
    > >>I have a problem with trigger. I don't find a way to disable it.
    > >>Oracle statement :
    > >>ALTER TRIGGER "TRG_DT_ACTI"  ENABLE
    > >>or
    > >>ALTER TRIGGER "TRG_DT_ACTI"  DISABLE
    > >>I am looking for a way to do the same thing with postgresql.
    > >>
    > >>I want to disable trigger before COPY and enable it after.
    > >>How can I do that?
    > >
    > >
    > > Drop and recreate respectively.
    > >
    > > HTH
    > >
    > >  Shridhar
    > >
    > >
    > > ---------------------------(end of broadcast)---------------------------
    > > TIP 3: if posting/reading through Usenet, please send an appropriate
    > > subscribe-nomail command to majordomo@postgresql.org so that your
    > > message can get through to the mailing list cleanly
    > >
    > 
    > ---------------------------(end of broadcast)---------------------------
    > TIP 3: if posting/reading through Usenet, please send an appropriate
    > subscribe-nomail command to majordomo@postgresql.org so that your
    > message can get through to the mailing list cleanly
    
    
    
  6. Re: trigger question.

    Dennis Gearon <gearond@cvc.net> — 2003-03-25T21:45:50Z

    I don't manage my database directly too much, just when needed. phpPgAdmin is 
    what I use, and it has the problem I described below. perhaps that is happening 
    in that library, and not at the postgres side of the exchange. As I get more 
    into this, and someday have my own box on the web, I will be doing more directly 
    manipulation of the database, from an admin POV as well.
    
    Jean-Luc Lachance wrote:
    > Have you looked at the output of "pg_dump -at" lately?
    > 
    > JL
    > 
    > Dennis Gearon wrote:
    > 
    >>As a follow up, I would read the  trigger into a file first, so that you can
    >>restore it. Also, watch single quotes and the semicolon at the end of the
    >>trigger definition. It may not show up correctly in the structure readout of the
    >>  trigger.
    >>
    >>And, you don't need to drop the functions that the trigger references, just the
    >>trigger.
    >>
    >>Shridhar Daithankar wrote:
    >>
    >>>On Tuesday 25 Mar 2003 9:31 pm, alain.bruneau@acoss.fr wrote:
    >>>
    >>>
    >>>>I have a problem with trigger. I don't find a way to disable it.
    >>>>Oracle statement :
    >>>>ALTER TRIGGER "TRG_DT_ACTI"  ENABLE
    >>>>or
    >>>>ALTER TRIGGER "TRG_DT_ACTI"  DISABLE
    >>>>I am looking for a way to do the same thing with postgresql.
    >>>>
    >>>>I want to disable trigger before COPY and enable it after.
    >>>>How can I do that?
    >>>
    >>>
    >>>Drop and recreate respectively.
    >>>
    >>>HTH
    >>>
    >>> Shridhar
    >>>
    >>>
    >>>---------------------------(end of broadcast)---------------------------
    >>>TIP 3: if posting/reading through Usenet, please send an appropriate
    >>>subscribe-nomail command to majordomo@postgresql.org so that your
    >>>message can get through to the mailing list cleanly
    >>>
    >>
    >>---------------------------(end of broadcast)---------------------------
    >>TIP 3: if posting/reading through Usenet, please send an appropriate
    >>subscribe-nomail command to majordomo@postgresql.org so that your
    >>message can get through to the mailing list cleanly
    > 
    >