EnterpriseDB + Red Hat = <3
This press release from Reuters about Red Hat investing in EnterpriseDB is great news.
Since Red Hat once manage to bring Linux to the room of Enterprise IT I'm hoping this would increase the acceptance of PostgreSQL adoption in the Enterprise world. We all know how slowly the Enterprise wheels are turning... :)
Interesting choice of words
Just read the article Is it Postgres' time to shine? and one sentence caught my attention:Postgres is an enterprise Java database, more suitable for carrying corporate data than the Web's consumer data.
My thought was "If I didn't know about PostgreSQL I would think that it was a database system written in Java". What's your take?
(As a side note I don't think that article was particularly interesting but I suspect CNET News to have a fair amount of management among their readers.)
strip html tags but keep href attribute value
To be able to match hostnames in links and at the same time get the benefits of tsearch I created a small function to strip of html tags while keeping the link intact for tsearch to tokenize.
The second regexp_replace is really not necessary since tsearch will ignore any HTML tags, or rather see them as XML tokens.
I'm sure there are more clever ways of accomplish the same thing but this seemed as a fine compromise for the moment. Thoughts and comments are of course welcome. :)
begin; -- strip tags function -- we use this to strip all html tags but still preserving the href -- attribute value so tsearch later can match host. span> -- Does two runs: -- 1) strip all tags containg the attribute href but preserve the -- attribute value and put it in parentheses. -- 2) strip of any remaining tags CREATE OR REPLACE FUNCTION strip_tags(TEXT) RETURNS TEXT AS $$ SELECT regexp_replace( regexp_replace($1, E'<[^>]*?(\s* href \s* = \s* ([\'"]) ([^>]*?) ([\'"]) ) [^>]*?>', E' (\\3) ', 'gx'), E'(< [^>]*? >)', E'', 'gx') $$ LANGUAGE SQL;