Postgresql – INSERT trigger dying with with #target columns not equal to #expressions, but they are equal

exceptioninsertpostgresqltrigger

I am trying to write my first trigger. It is an insert trigger as follows:

<b>Fatal error</b>:  postgres7 error: [-1: ERROR:  INSERT has more target columns than expressions at character 78

INSERT INTO
dash_pre_queue
            (ord_obj_guid,
             ord_entry_type_guid,
             client_obj_guid, 
             installer_obj_guid, 
             installer_serial_number, 
             datetime, 
             ord_proc_state_guid,
             created,
             ord_esc_type_guid,
             in_error,
             ord_entry_guid)
SELECT
    (ord_obj_guid,
            NULL,
            client_obj_guid,
            inst_obj.inst_obj_guid,
            inst_obj.installer_serial_number,
            clock_timestamp(),
            ord_proc_state_guid,
            NULL,
            NULL,
            NULL,
            NULL)
    FROM
            ord_obj
    JOIN
            inst_obj ON inst_obj.inst_obj_guid = ord_obj.inst_obj_guid
    WHERE
            ord_obj.ord_obj_guid = NEW.ord_obj_guid

I left the error message on top. The structure of the target table matches the INSERT INTO columns. I have verified the NULL values are allowed.

If you count the columns in the Insert clause, they match the SELECT statement, yet, I get the error above stating that there is somehow a disconnect. Any ideas as to what I am doing wrong?

Best Answer

Remove parens around column list in select. This doesn't do what you think it does.