Any hope for more specific error message for "value too long..."? - Mailing list pgsql-general
From | Ken Tanzer |
---|---|
Subject | Any hope for more specific error message for "value too long..."? |
Date | |
Msg-id | CAD3a31WR8X1TpjR_MoZxuz4S0BO3ZkPAeLoQ9rPxKHG=728eoQ@mail.gmail.com Whole thread Raw |
Responses |
Re: Any hope for more specific error message for "value too long..."?
Re: Any hope for more specific error message for "value too long..."? Re: Any hope for more specific error message for "value too long..."? |
List | pgsql-general |
Hi. If you try to assign a too-long string to a field, Postgresql will say so, but won't tell you which value/field is causing the problem:
--
CREATE TEMP TABLE foo (a VARCHAR(2)); INSERT INTO foo VALUES ('ABC'); CREATE TABLE ERROR: value too long for type character varying(2)
That doesn't matter much in a simple example like that, but the example below is currently making me wish PG was just a little bit more specific. Is there much chance of this changing in future releases?
Cheers,
Ken
INSERT INTO tbl_membership_info (client_id,membership_info_ date,survey_schedule_code,hs_ homeless_past_code,hs_ homeless_past_skip_code,hs_ live_last_30_code,hs_live_ last_30_skip_code,hs_live_ last_30_institution,hs_live_ last_30_other,hs_live_ satisfied_code,hs_live_ satisfied_skip_code,hs_live_ improve_code,hs_live_improve_ skip_code,hs_rc_help_improve_ code,hs_rc_help_improve_skip_ code,hs_rc_help_maintain_code, hs_rc_help_maintain_skip_code, da_desire_recovery_code,da_ desire_recovery_skip_code,da_ rc_desire_recovery_code,da_rc_ desire_recovery_skip_code,da_ in_recovery_alcohol_code,da_ in_recovery_alcohol_skip_code, da_30_alcohol_days,da_30_ alcohol_days_skip_code,da_rc_ prevent_alcohol_relapse_code, da_rc_prevent_alcohol_relapse_ skip_code,da_rc_prevent_ alcohol_relapse_how,da_in_ recovery_drug_code,da_in_ recovery_drug_skip_code,da_30_ drug_days,da_30_drug_days_ skip_code,da_rc_prevent_drug_ relapse_code,da_rc_preve
nt_drug_relapse_skip_code,da_ rc_prevent_drug_relapse_how, da_in_recovery_affliction_ codes,da_in_recovery_ affliction_other,da_in_ recovery_affliction_skip_code, hmh_overall_physical_code,hmh_ overall_physical_skip_code, hmh_physical_care_where_code, hmh_physical_care_where_other, hmh_physical_care_where_skip_ code,hmh_physical_care_er_90_ days,hmh_physical_care_er_90_ days_skip_code,hmh_physical_ improve_code,hmh_physical_ improve_skip_code,hmh_rc_ physical_improve_code,hmh_rc_ physical_improve_skip_code, hmh_overall_mh_code,hmh_ overall_mh_skip_code,hmh_mh_ care_where_code,hmh_mh_care_ where_other,hmh_mh_care_where_ skip_code,hmh_mh_care_er_90_ days,hmh_mh_care_er_90_days_ skip_code,hmh_rc_mh_improve_ code,hmh_rc_mh_improve_skip_ code,hmh_rc_mh_stabilize_code, hmh_rc_mh_stabilize_skip_code, hmh_rc_access_resource_type_ codes,hmh_rc_access_resource_ type_other,hmh_rc_access_ resource_type_skip_code,ad_ hope_code,ad_hope_skip_code, ad_rc_assist_hope_code,ad_rc_ assist_hope_skip_code,ad_cope_ code,ad_cope_ski
p_code,ad_rc_assist_cope_code, ad_rc_assist_cope_skip_code, ad_connected_code,ad_ connected_skip_code,ad_rc_rc_ connected_code,ad_rc_rc_ connected_skip_code,ad_rc_ circle_connected_code,ad_rc_ circle_connected_skip_code,ad_ rc_connection_type_codes,ad_ rc_connection_type_other,ad_ rc_connection_type_skip_code, comment,added_by,changed_by, sys_log,changed_at) VALUES ('3220','2017-12-26','T4',' YES',NULL,'SUBSIDIZED',NULL, NULL,NULL,'YES',NULL,'YES_ ALITTLE',NULL,'NONE',NULL,' YES_ALITTLE',NULL,'HIGH',NULL, 'YES_ALITTLE',NULL,'YES',NULL, '10',NULL,'NO',NULL,NULL,NULL, 'NO_ANSWER',NULL,'NO_ANSWER', NULL,'NO_ANSWER',NULL,NULL, NULL,'NO_ANSWER','GOOD',NULL,' DOCTOR',NULL,NULL,NULL,'NO_ ANSWER','SOMEWHAT',NULL,' MEDIUM',NULL,'FAIR',NULL,' COUNSELOR',NULL,NULL,NULL,'NO_ ANSWER','MEDIUM',NULL,'YES', NULL,NULL,NULL,'NO_ANSWER',' HIGH',NULL,'NEUTRAL',NULL,' FAIR',NULL,'NEUTRAL',NULL,' SOMEWHAT',NULL,'VERY',NULL,' SOMEWHAT',NULL,'{SUPPORT_12, SUPPORT_AA}',NULL,NULL,NULL,' 537','537',NULL,CURRENT_ TIMESTAMP) RETURNING
* The PostgreSQL server reported an error.
The error text was: ERROR: value too long for type character varying(10)
nt_drug_relapse_skip_code,da_
p_code,ad_rc_assist_cope_code,
* The PostgreSQL server reported an error.
The error text was: ERROR: value too long for type character varying(10)
AGENCY Software
A Free Software data system
By and for non-profits
(253) 245-3801
learn more about AGENCY or
follow the discussion.
pgsql-general by date: