[GENERAL] How to intelligently work with views that depend on other views

2015-08-06 Thread W. Matthew Wilson
GRESQL! -- W. Matthew Wilson m...@tplus1.com http://tplus1.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] How to insert either a value or the column default?

2014-08-23 Thread W. Matthew Wilson
I still don't want to break my "no string interpolation" rule of thumb unless I absolutely have to. And I know I could switch to some gigantic library like SQLAlchemy, but I really don't want to. Any advice is welcome. Thanks in advance! Matt -- W. Matthew Wilson

Re: [GENERAL] How to insert either a value or the column default?

2014-08-25 Thread W. Matthew Wilson
On Sun, Aug 24, 2014 at 2:50 PM, Daniele Varrazzo wrote: > It should be added to the library (it was first discussed in 2003...), > but it's one of these things that will stop working when psycopg will > start using the "extended query protocol" (together with other nifty > features such as string

[GENERAL] How to join table to itself N times?

2013-03-20 Thread W. Matthew Wilson
ols.product(*[['north', 'south'], ['retail', 'manufacturing', 'wholesale']])) [('north', 'retail'), ('north', 'manufacturing'), ('north', 'wholesale'), ('south', 'retail'), ('south', 'manufacturing'), ('south', 'wholesale')] All advice is welcome. Thanks in advance! Matt -- W. Matthew Wilson m...@tplus1.com http://tplus1.com

[GENERAL] How to tame a gigantic (100+ lines) query in a web app?

2011-08-14 Thread W. Matthew Wilson
re both able to make their own temporary tables. More generally, how to tame this big ol' query? The temporary tables mean I'm only pulling data from the database one time. ORMs often pull data from one query and then use that data to write the next query. This seems slow to me. Matt --

[GENERAL] How to do a full-text search words within some proximity of each other?

2012-09-24 Thread W. Matthew Wilson
search. Is it possible? I understand that I can do a query and rank the results by how closely the words are to each other, but I want to exclude any matches where the words are not within two words of each other. Thanks in advance! Matt -- W. Matthew Wilson m...@tplus1.com http://tplus1.

[GENERAL] Rank based on the number of matching OR fields?

2012-09-25 Thread W. Matthew Wilson
I want to run a query like to_tsquery("A | B | C") and then rank the results so that if a document contained A, B, and C, then it would rank above a document that just had some subset. How would I do such a thing? -- W. Matthew Wilson m...@tplus1.com http://tplus1.com -- Sent