Postgre triggers saves t and f instead of true and false

Viewed 23

I have created a trigger on a table to audit the changes but there is some problem related to a boolean data type that is saved into an audit table.

create table user {
  email text,
  active boolean
}

I want to audit the changes in the above table like when a user's active status changes from true to false and save it to another table. Below is the audit table structure.

create table audit_table {
   column_name text,
   old_value text,
   new_value text
}

To do this I have created a trigger but when I see the audit_table the true and false values are stored as t and f.

0 Answers
Related