[SQL] Single Quote in tsquery

2008-08-05 Thread Ryan Wallace
Hi all, I am trying to perform a full text search for the word 'ksan (which starts with a quote). After much frustration and syntax errors I stumbled upon the following statement which seems to work: select * from items where to_tsvector(name) @@ to_tsquery(E'[\']ksan') I would like to know if

Re: [SQL] Identifying which column matches a full text search

2008-07-30 Thread Ryan Wallace
ch blocks table, how do you search it? Do you perform twelve separate queries or can you just do one? Ryan Ryan Wallace wrote: > > UPDATE pgweb SET textsearchable_index_col = > to_tsvector('english', coalesce(title,'') || coalesce(body,'')); > WH

[SQL] Identifying which column matches a full text search

2008-07-29 Thread Ryan Wallace
Hi all, The following example is given in the Postgres 8.3 manual regarding how to create a single ts_vector column for two existing columns: ALTER TABLE pgweb ADD COLUMN textsearchable_index_col tsvector; UPDATE pgweb SET textsearchable_index_col = to_tsvector('english', coalesce(ti

[SQL] Working with dates before 4713 BC

2008-05-05 Thread Ryan Wallace
Hi all, I am building an application which requires the storage of dates relating to the creation of archaeological items. The problem I am facing is that although most of the dates are working fine, some of the items were created before the beginning of recorded history (4713 BC). Does an

[SQL] improvements to query with hierarchical elements

2008-01-20 Thread Ryan Wallace
Greetings, I have a complex query which I am trying to figure out the most efficient way of performing. My database is laid out as follows: items -have_many-> events -have_many-> event_locations -have_many-> locations also rows in the location_links table link two locations together in