var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: General search
I would like to search a whole table (all clomns and rows) with a cretain search term. Is there any way for this more efficient than looping over all columns?
If you don't want to use any external tools, than "manually" looping over all columns will be your only choice I guess.
If this is for a specific table where you know the columns, you might want to try concatenating all columns and then search on that string:
But this will get ugly when you have more columns. Also you should probably use some delimiter between the columns.
WHERE cast(column_1 as text)||to_char(date_column, 'yyyy-mm-dd')||cast(column_3 as text) LIKE '%some_value%';
which external tools did you have in mind?
The only one I know that can do this is SQL Workbench/J
It has a special (i.e. proprietary) "SQL" command to search through all columns in all tables (or a list of tables):
And it can be done through the GUI as well, this looks like this then:
if you use linux just select all data from a table to the system output and grep for a string
psql -c "select * from ..." databasename | grep "search for a string" > "write_result_to_a_file"