I built a series of views in a PostgreSQL database that includes a couple of columns of an array. The view definition is as follows:
Essentially, what I want to do is iLike in the author column to determine if a specific user ID exists in this array. Obviously, I cannot use iLike in this data type, so I need to find a different approach.
{"(2373, t, e, f, \" 2011-08-01 11:57:40:69,696 \ "/ Pubs/pubs_edit_article.php, \" 2011-08-09 15:36:29,281833 \ " 000128343, A00592, Author, 1, Nicholas, K., Kreidberg, \ "\", 123456789, t, Administrator, A, A, A, 0, \ "\") "," (2374, t, e, e , \ "2011-08-01 11: 57: 40,706617 \" / Pubs/pubs_edit_article.php, \ "2011-08-09 15: 36: 29,285428 \" 000128343, A00592, Author, 2, John D ., Doe, \ "\", 234567890, t, IT, A, A, A, 0, \ "\") "," (2381, t, e, e, \ "2011-08-09 14:45 : 14,870418 \ "000128343, \" 2011-08-09 15:36: 29,28854 \ "000128343, A00592, Author, 3, Jane, E, Doe, \" \ ", 345678901, t, Admin, A , A, A, \ "\") "," (2383, t, e, e, \ "2011-08-09 15: 35: 11,845283 \" 567890123, \ "2011-08-09 15: 36 : 29.291388 \ "000128343, A00592, Author, 4, tests, T, Testerton, \" \ ", TestTesterton, F, N / A, A, A, A, \" \ ")"}
What I want to do is query in the view and find out if the string "123456789" exists in the array (that is, the user ID assigned to Nikolai Kreidberg in the array). I donβt care which user is assigned or where it appears in the array, all I need to know is if "123456789" is displayed anywhere in the array.
As soon as I know how to write a request that determines whether the above condition is true, my application will simply execute this request, and if the rows are returned, it will know that the user ID passed to the request is the author of this publication and act accordingly .
Thanks in advance for any information that may be provided on this topic.