I use the pg_array extension and the continuation of version 4.1.1.
I added the extension as follows:
Sequel::Database.extension :pg_array
I created a column like this:
alter_table :emails do
add_column :references, "text[]", null: true
end
I can load and retrieve arrays into columns of a postgress array, just like working with regular arrays.
From the link above it is not clear how to execute the query based on the values in this column of the array.
For example, if one row in the email table contained these values in the link column:
references
--------------------------------------------------------------------
{}
{5363f773bccf9_32123fe75c45e6f090953@Pauls-MacBook-Pro.local.mail}
How can I query the email table to find a string containing the value of an array of links of the specified value:
Email.where(references: ????)
source
share