[SQL] Converting epoch to timestamp?

2001-07-31 Thread Roberto Mello
I searched the docs for function to convert epoch to timestamps but couldn't find any. Are there any? Thanks, -Roberto -- +| Roberto Mello - http://www.brasileiro.net |+ Computer Science, Utah State University - http://www.usu.edu USU

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Timothy H. Keitt
Oh and despite the copyright notice, I'm happy to put it in the public domain, so feel free to incorporate into postgresql. Tim Timothy H. Keitt wrote: > I posted this many moons ago to pgsql-hackers. 'Guess nobody noticed. > > Tim > > Josh Berkus wrote: > >> Folks, >> >> For many of my progr

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Timothy H. Keitt
I posted this many moons ago to pgsql-hackers. 'Guess nobody noticed. Tim Josh Berkus wrote: >Folks, > >For many of my programs, it would be extremely useful to have some form >of "fuzzy matching" for VARCHAR fields. There are two kinds of fuzzy >matching for words that I know of: > >1. Phone

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Christopher Sawtell
On Wed, 01 Aug 2001 05:44, Tom Lane wrote: > "Josh Berkus" <[EMAIL PROTECTED]> writes: > > For many of my programs, it would be extremely useful to have some form > > of "fuzzy matching" for VARCHAR fields. There are two kinds of fuzzy > > matching for words that I know of: > > > > 1. Phonetic ma

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > I'm quite interested, myself. How difficult is it for somebody that > doesn't program C to attach a function from the Contrib directory? Run the install script. > If it's not very difficult, then I'd recommend putting metaphone in > /contrib, and leve

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Josh Berkus
Tom, Joe, > Our usual practice with stuff of uncertain usefulness has been to > stick > it in contrib for awhile and see if anyone uses it. If there's > sufficient interest, we'll promote it to mainstream in a future > release. Makes sense to me. Go, Joe! Since I can't help with the porting o

[SQL] RE: Fuzzy matching?

2001-07-31 Thread Jeff Eckermann
With version 7.2 we will have pl/perlu (untrusted), which will allow use of the various Perl modules which do this sort of thing. > -Original Message- > From: Josh Berkus [SMTP:[EMAIL PROTECTED]] > Sent: Tuesday, July 31, 2001 1:16 PM > To: Joe Conway; Bruce Momjian > Cc: Josh Berkus;

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Tom Lane
"Joe Conway" <[EMAIL PROTECTED]> writes: > In any case, metaphone is reportedly more accurate (at least for English > words) than soundex, and levenshtein offers an entirely different and > interesting approach. Any interest in having all three of these in the > backend? I'd certainly accept such

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Josh Berkus
Joe, > > Sounds like you want something along the lines of soundex or > metaphone? I > > don't see either function in PostgreSQL, but take a look at the PHP > manual > > to see examples: http://www.php.net/manual/en/function.soundex.php > , > > http://www.php.net/manual/en/function.metaphone.php

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Josh Berkus
Joe, > In any case, metaphone is reportedly more accurate (at least for > English > words) than soundex, and levenshtein offers an entirely different and > interesting approach. Any interest in having all three of these in > the > backend? I'm quite interested, myself. How difficult is it for s

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Bruce Momjian
> Sounds like you want something along the lines of soundex or metaphone? I > don't see either function in PostgreSQL, but take a look at the PHP manual > to see examples: http://www.php.net/manual/en/function.soundex.php , > http://www.php.net/manual/en/function.metaphone.php > See /contrib/sou

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Joe Conway
> > > > Actually, this may even be closer to what you want: > > http://www.php.net/manual/en/function.levenshtein.php > > Hey, that's terrific! I didn't know that those programs existed > outside fo expensive proprietary software. > > Now, who can I talk into porting them (metaphone, levenstein)

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Bruce Momjian
> > See /contrib/soundex. > > Sorry, missed that -- I only looked in the Documentation :( > I guess it's not there because it is a contrib. FWIW, both Oracle and MSSQL > have a built-in soundex function. > > In any case, metaphone is reportedly more accurate (at least for English > words) than s

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Joe Conway
> > Sounds like you want something along the lines of soundex or metaphone? I > > don't see either function in PostgreSQL, but take a look at the PHP manual > > to see examples: http://www.php.net/manual/en/function.soundex.php , > > http://www.php.net/manual/en/function.metaphone.php > > > > See

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > For many of my programs, it would be extremely useful to have some form > of "fuzzy matching" for VARCHAR fields. There are two kinds of fuzzy > matching for words that I know of: > 1. Phonetic matching, which would be nice but will have to wait for >

RE: [SQL] Fuzzy matching?

2001-07-31 Thread Robby Slaughter
Here's an off the cuff reply: It sounds like fuzzy_match(str1,str2,num) is really just a tokenizer-type operation. The number is exactly one less than the potential number of string segments that you are interested in. For example: fuzzy_match('Thornton','Tornton',1) = TRUE Because the two

Re: [SQL] Fuzzy matching?

2001-07-31 Thread Joe Conway
> And the fuzzy_match should return True if the two phrases are no more > than that number of characters different. Thus, we should get: > > fuzzy_match('Thornton','Tornton',1) = TRUE > fuzzy_match('Thornton','Torntin',1) = FALSE > fuzzy_match('Thornton','Torntin',2) = TRUE > > Unfortunately, I c

[SQL] Fuzzy matching?

2001-07-31 Thread Josh Berkus
Folks, For many of my programs, it would be extremely useful to have some form of "fuzzy matching" for VARCHAR fields. There are two kinds of fuzzy matching for words that I know of: 1. Phonetic matching, which would be nice but will have to wait for someone's $100,000 project; 2. Textual math

Re: [SQL] union in subselect?

2001-07-31 Thread Tom Lane
Gary Stainburn <[EMAIL PROTECTED]> writes: > select * from actions where cposn in (select posn from positions where pholder > = 81 union select 'NEC' as posn from members where mnec = true and mid = 81); > gives me: > ERROR: parser: parse error at or near "union" Update to PG 7.1.

Re: [SQL] Get name of columns in a table

2001-07-31 Thread Richard Huxton
María Elena Hernández wrote: > To get a list of columns, run "psql -E" and do a standard "\df foo" where foo is your table name. This will show you exactly how PG does it. I've found this very useful with all the backslash commands. HTH - Richard Huxton ---(end of broad

[SQL] union in subselect?

2001-07-31 Thread Gary Stainburn
Hi all, Can you use (or work around towards) a union in a subquery? I have :- Members mid int4; mnec bool; -- many NEC members Positions (one position = one holder - excludes NEC) posnchar(4); pholder int4; -- refers to mid Actions caction char(4) -- e.g. UPDT = update team cposn char