Re: [SQL] Compare strings which resembles each other

2003-11-21 Thread Oleg Bartunov
On Fri, 21 Nov 2003, Ian Barwick wrote: > On Friday 21 November 2003 15:32, Oleg Bartunov wrote: > > On Fri, 21 Nov 2003, Christoph Haller wrote: > > > > $PGSQLD/contrib/tsearch/README.tsearch > > > is your friend. > > > > I think tsearch(2) isn't what Gulshan need. He needs fuzzy search, > > ther

Re: [SQL] Compare strings which resembles each other

2003-11-21 Thread Ian Barwick
On Friday 21 November 2003 15:32, Oleg Bartunov wrote: > On Fri, 21 Nov 2003, Christoph Haller wrote: > > $PGSQLD/contrib/tsearch/README.tsearch > > is your friend. > > I think tsearch(2) isn't what Gulshan need. He needs fuzzy search, > there are several modules in contrib directory (metaphone, f

Re: [SQL] cast varchar to numeric/money

2003-11-21 Thread Tomasz Myrta
Dnia 2003-11-21 19:26, Użytkownik Yudie napisał: I don't have to_numeric function in my 7.2.2 postgre. then it can resolve it with: cast(substr(varcharcolumn,0) as float4) Read once again. The function is not "to_numeric", but "to_number". You can read about this function in manual: 6.7. Data Typ

Re: [SQL] How to quote date value?

2003-11-21 Thread Stephan Szabo
On Fri, 21 Nov 2003, Gaetano Mendola wrote: > nobody wrote: > > I have found it in documentation, it is single quote. But it does not > > explain why > > > > SELECT '1/11/2003' AS "InvoiceDate"; > > > > returns "unknown" data type instead of "date". (I haven't seen the original message yet, so I

Re: [SQL] Expressional Indexes

2003-11-21 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > No, because the above represents a moving cutoff; it will (and should) > be rejected as a non-immutable predicate condition. You could do > something like > > CREATE INDEX my_Nov_03_index on my_table (create_date) > WHERE (cre

Re: [SQL] cast varchar to numeric/money

2003-11-21 Thread Yudie
I don't have to_numeric function in my 7.2.2 postgre. then it can resolve it with: cast(substr(varcharcolumn,0) as float4) thanks. - Original Message - From: "Bruno Wolff III" <[EMAIL PROTECTED]> To: "Yudie" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, November 21, 2003

Re: [SQL] How to quote date value?

2003-11-21 Thread Gaetano Mendola
nobody wrote: I have found it in documentation, it is single quote. But it does not explain why SELECT '1/11/2003' AS "InvoiceDate"; returns "unknown" data type instead of "date". Why not a string ? or a fancy custom type ? Regards Gaetano Mendola ---(end of broadcast)--

Re: [SQL] cast varchar to numeric/money

2003-11-21 Thread Bruno Wolff III
On Fri, Nov 21, 2003 at 11:47:42 -0600, Yudie <[EMAIL PROTECTED]> wrote: > Hi guys, > > I know it's impossible to just cast varchar to any numeric datatype, > but is there another function/ custom function or any way to force to do > that convertion. You can use to_number to go from text to num

[SQL] cast varchar to numeric/money

2003-11-21 Thread Yudie
Hi guys, I know it's impossible to just cast varchar to any numeric datatype, but is there another function/ custom function or any way to force to do that convertion. please help Thanks.. Yudie ---(end of broadcast)--- TIP 9: the planner will i

Re: [SQL] Compare strings which resembles each other

2003-11-21 Thread Oleg Bartunov
On Fri, 21 Nov 2003, Christoph Haller wrote: > > > > Hy, I have a table containing some rows. Each row contains a field name > > which is of type String. > > > > For example: > > in row1 string1 is "Adieu Poulet", > > in row2 string2 is "Adieu a Poulet", > > in row3 string3 is "Adiue Poulet", > >

Re: [SQL] Compare strings which resembles each other

2003-11-21 Thread Christoph Haller
> > Hy, I have a table containing some rows. Each row contains a field name > which is of type String. > > For example: > in row1 string1 is "Adieu Poulet", > in row2 string2 is "Adieu a Poulet", > in row3 string3 is "Adiue Poulet", > in row4 string4 is "Adieu Pouleet", etc.. > (That is each stri

Re: [SQL] Need another way to do this, my sql much to slow...

2003-11-21 Thread Christoph Haller
> > Ok, I figured that part out by simply changing the way I'm doing to > query, and writing a function to handle the reply. But it will introduce > another problem. How to I pass special characters, any character, to a > function like this: > > select msg_2_env('"Ann's Free Gifts & Coupons" > <[

Re: [SQL] Substrings by Regular Expression

2003-11-21 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > On Fri, 14 Nov 2003, Jim Drummey wrote: >> pds=> select substring( str1 from ',' ) from address; >> ERROR: pg_atoi: error in ",": can't parse "," >> >> Am I missing something? > That functionality was added in 7.3 I believe. You may wish > to upgrade