DROP TRIGGER トリガー名 ON テーブル名;

testdb=# \df                               
                            List of functions
 Schema |      Name       | Result data type | Argument data types | Type 
--------+-----------------+------------------+---------------------+------
 public | log_time_writer | trigger          |                     | func
 public | sample_func     | boolean          | text                | func
(2 rows)

ttestdb=# CREATE TRIGGER sample_trg BEFORE INSERT OR UPDATE OR DELETE ON sample
testdb-# EXECUTE PROCEDURE log_time_writer();
testdb=# \d sample;
                    Table "public.sample"
 Column  |  Type   | Collation | Nullable |     Default      
---------+---------+-----------+----------+------------------
 no      | integer |           | not null | 
 name    | text    |           |          | 
 groupno | integer |           |          | 
 memo    | text    |           |          | '特になし'::text
Indexes:
    "sample_pkey" PRIMARY KEY, btree (no)
    "sample_index" btree (no, groupno)
Triggers:
    sample_trg BEFORE INSERT OR DELETE OR UPDATE ON sample FOR EACH STATEMENT EXECUTE PROCEDURE log_time_writer()
testdb=# DROP TRIGGER sample_trg ON sample;
DROP TRIGGER
testdb=# \d sample
                    Table "public.sample"
 Column  |  Type   | Collation | Nullable |     Default      
---------+---------+-----------+----------+------------------
 no      | integer |           | not null | 
 name    | text    |           |          | 
 groupno | integer |           |          | 
 memo    | text    |           |          | '特になし'::text
Indexes:
    "sample_pkey" PRIMARY KEY, btree (no)
    "sample_index" btree (no, groupno)

この記事が気に入ったらサポートをしてみませんか?