Thread

  1. BUG #19352: SQL Error messages do not include schema name along with table or data object name.

    PG Bug reporting form <noreply@postgresql.org> — 2025-12-12T02:14:40Z

    The following bug has been logged on the website:
    
    Bug reference:      19352
    Logged by:          David Keeshin
    Email address:      keeshd@keeshinds.com
    PostgreSQL version: 16.11
    Operating system:   Linux
    Description:        
    
    Here's an actual error that I received:
    
    "Error moving summary data: Error in up_move_from_stage for control_id
    c5bcfbd9-1f20-42c1-bb0c-be626b3c15eb:
    insert or update on table "followup_data_flow_by_topic" violates
    foreign key constraint "followup_data_flow_by_topic_by_topic_id_fkey2" 23503
    CONTEXT: PL/pgSQL function interview.up_move_from_stage(uuid,boolean) line
    166 at RAISE"
    
    It's confusing.  I have a "stage" schema and a "interview" schema in the
    database.  There is a "followup_data_flow_by_topic'  table in the stage
    "schema" and one in the "interview"  schema.  I did just noticed that the
    end of the message does include the schema name for the stored procedure -
    which by the was created as a  stored procedure, not a function.
    
    Ideally this error message would be clearer if the schema name was included
    with the data table or object name.  i.e.
    
    "Error moving summary data: Error in interview.up_move_from_stage for
    control_id c5bcfbd9-1f20-42c1-bb0c-be626b3c15eb:
    insert or update on table "interview.followup_data_flow_by_topic" violates
    foreign key constraint
    "interview.followup_data_flow_by_topic_by_topic_id_fkey2" 23503
    CONTEXT: PL/pgSQL function interview.up_move_from_stage(uuid,boolean) line
    166 at RAISE"