[GENERAL] Type to to_char(d, 'J')?

2013-07-31 Thread Marc Dahn
Dear list, Section 9.8 of the postgres (9.1) documentation says, on the patterns for to_char(timestamp, pattern),: J Julian Day (days since November 24, 4714 BC at midnight) This leaves open the question of what's actually returned. At least in astronomy, it is customary to have fractiona

[GENERAL] Full text search, SQL functions, and the planner

2013-06-07 Thread Marc Dahn
Hi, To maintain an externally defined interface, I'd like to define a function hasword(haystack, needle) that (essentially) returns 1 when to_tsvector(haystack) @@ to_tsquery(needle), 0 otherwise. I've tried CREATE OR REPLACE FUNCTION ivo_hasword(haystack TEXT, needle TEXT) RETUR