code added to lib/pg_data_encoder.rb