I’m developing rails application on Postgres.
One problem that I’ve been experiencing is when I try to assign an empty text(”) to a text column value. it only recognizes that the text I want to assign is two single quotes as text value literally.
My table schema:
create_table :products do |t|
t.integer :seq
t.string :title
t.text :description
t.timestamps
end
My problematic migration:
Product.create({:seq => 1, :title => 'green_cos', :description => ''})
Here is the resulting record:

Any advice on what I should do to get the proper empty string to be assigned?
or it expects me to assign a nil value instead. Does the way it treat empty and nil text differ from other database? I used what I mentioned with SQL Server before without any problem.
There is no problem. The quotes are NOT part of the value or in other words they are not stored in the DB. They are only used in ruby to designate a string value (the actual value is between the quotes). pgAdmin happens to display ” for an empty string to differentiate an empty string from a NULL value. NULL values are displayed as empty cells in pgAdmin it would get confusing if an empty string also resulted in a empty cell.