Link to home
Start Free TrialLog in
Avatar of abgtemp
abgtempFlag for United States of America

asked on

Search all columns in Postgresql table

I am looking for a way to allow a user from a web front end to query all columns in a postgresql table for multiple values. So if had a tabled named Orders that has columns "id, date, customer, product".

I would like allow the user to be able to search for all entries in the table where the customer Bill ordered lamps by passing a search value of "Bill + Lamps" or something similar to this.

I'm thinking I will need to setup full-text search, but I wasn't sure if this is the case and how to set it up.
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Suggest you create a script that uses SELECT * to get all of the information in all of the rows in the table, and that uses var_dump() to put all of this information on the screen.  Feed the resulting pages to Google "site search" and see if you get the results you want.  If that works, you can refine the var_dump() output to make something that is more eye-pleasing to the client.

Not sure what your table structure might look like, but I am guessing that you have more than one table?  If so, you will need to write a "view" script for every possible relationship between the tables.  This may be a big and time-consuming task.  Whether you choose to use a pre-existing service like Google or invent your own search with full-text searching will largely be decided by how much time and budget you have available.  Google will likely be faster and less expensive.
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial