# Postgres and data type text issue

**URL:** <https://www.ruby-forum.com/t/postgres-and-data-type-text-issue/103589>\
**Category:** Rails\
**Created:** [May 8, 2007, 5:25am UTC](https://www.ruby-forum.com/t/postgres-and-data-type-text-issue/103589 "2007-05-08T05:25:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9e8a1a/32.png) [@rickf](https://www.ruby-forum.com/u/rickf)\
**Post date:** [May 8, 2007, 5:25am UTC](https://www.ruby-forum.com/t/postgres-and-data-type-text-issue/103589/1 "2007-05-08T05:25:24Z")

</div>

Hi Gurus,

I have a Postggres field as a data type of text that is used to hold  
some configuration information in ini file format. This is a legacy  
application db. The current requirement is for the text field to be  
null-terminated at the end.

I get a failure when I try to perform the save with a null-termination  
in the SQL VALUES statement. Without the NULL termination the save works  
fine.

Am I getting the error because the postgres-pr or abstract driver thinks  
this is a SQL injection type attack or because the log method gets  
balled up on the null? What is the easiest way to debug this stuff?

Any information is appreciated. The error message is as follows:

ArgumentError: Invalid Ruby/cstring: INSERT INTO

Ths stack:  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active\_record/connection\_adapters/abstract\_adapter.rb:128:in  
`log' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/postgresql_adapter.rb:152:in`execute’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active\_record/connection\_adapters/postgresql\_adapter.rb:136:in  
`insert’

Any insight is appreciated,  
Rick
