Thread: search facilities
Hi, I have a content management system, for my database driven website developed using php and postgresql but I don't know how to develop a search facility for it. How do I go about it?. I have seen database driven website developed using php and postgresql and they have their built search facilities where can I learn to develop my customized search facility please do advice. Kind Regards +-----------------------------------------------------+ | Martin W. Kuria (Mr.) martin.kuria@unon.org +----------------------------------------------------+ _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail
<p>Hi,<p>i am converting a MSSQL Server database to PostgreSQL.<p>Using PostgreSQL version 7.3.2.<p>Is there any functionlike the DateDiff() in MSSQL Server. <p>ie, a function that returns difference of two dates(timestamp) in days ormonths or year..<p>The - operator for timestamp retuns the intervel in days only.<p>Please help<p>jinujose<p><hr size="1"/> Do you Yahoo!?<br /><a href="http://antispam.yahoo.com/whatsnewfree">Protect your identity with Yahoo! Mail AddressGuard</a>
Dnia 2003-11-07 14:34, Użytkownik George A.J napisał: > Hi, > > i am converting a MSSQL Server database to PostgreSQL. > > Using PostgreSQL version 7.3.2. > > Is there any function like the DateDiff() in MSSQL Server. > > ie, a function that returns difference of two dates(timestamp) in days > or months or year.. > > The - operator for timestamp retuns the intervel in days only. 1. You can convert timestamps to dates and then substract them. The result will be days::integer. 2. Interval result is not a problem - you can extract epoch from it. The result is seconds::integer - do whatever you want with it. Regards, Tomasz Myrta
> ie, a function that returns difference of two dates(timestamp) in days > or months or year.. > > The - operator for timestamp retuns the intervel in days only. rbt=# select extract('days' from current_timestamp - '2003-01-01'::timestamp);date_part ----------- 310 (1 row)
Check contrib/tsearch2 and http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2 for documentation Oleg On Fri, 7 Nov 2003, Martin Kuria wrote: > Hi, > I have a content management system, for my database driven website developed > using php and postgresql but I don't know how to develop a search facility > for it. > > How do I go about it?. > > I have seen database driven website developed using php and postgresql and > they have their built search facilities where can I learn to develop my > customized search facility please do advice. > > Kind Regards > > +-----------------------------------------------------+ > | Martin W. Kuria (Mr.) martin.kuria@unon.org > +----------------------------------------------------+ > > _________________________________________________________________ > Tired of spam? Get advanced junk mail protection with MSN 8. > http://join.msn.com/?page=features/junkmail > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83
Download the latest version of PostgreSQL and look in the contrib/tsearch or contrib/tsearch2 directories. For documentation, see: http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/ http://sourceforge.net/mailarchive/forum.php?forum_id=7671 George Essig ___________________________________________ Original Message: Hi, I have a content management system, for my database driven website developed using php and postgresql but I don't know how to develop a search facility for it. How do I go about it?. I have seen database driven website developed using php and postgresql and they have their built search facilities where can I learn to develop my customized search facility please do advice. Kind Regards +-----------------------------------------------------+ | Martin W. Kuria (Mr.) martin.kuria@unon.org +----------------------------------------------------+
Hi, You can use the age() function to find the difference between dates, and use the extract() function to get the years, months, days, etc. Yasir On Fri, 7 Nov 2003, George A.J wrote: > Date: Fri, 7 Nov 2003 05:34:09 -0800 (PST) > From: George A.J <jinujosein@yahoo.com> > To: pgsql-sql@postgresql.org > Subject: [SQL] DateDiff in PostgreSQL > > > Hi, > > i am converting a MSSQL Server database to PostgreSQL. > > Using PostgreSQL version 7.3.2. > > Is there any function like the DateDiff() in MSSQL Server. > > ie, a function that returns difference of two dates(timestamp) in days or months or year.. > > The - operator for timestamp retuns the intervel in days only. > > Please help > > jinujose > > > --------------------------------- > Do you Yahoo!? > Protect your identity with Yahoo! Mail AddressGuard
Bartunov, Thanks alot for you reply, please clarify for me something; I have a database driven website developed using php and postgresql database, can I use tsearch facility and customize it to search my database driven website like how postgresql.org is search please do advice thanks again Kind regards +-----------------------------------------------------+ | Martin W. Kuria (Mr.) martin.kuria@unon.org +----------------------------------------------------+ >From: Oleg Bartunov <oleg@sai.msu.su> >To: Martin Kuria <martinkuria@hotmail.com> >CC: olly@lfix.co.uk, pgsql-sql@postgresql.org >Subject: Re: [SQL] search facilities >Date: Sat, 8 Nov 2003 10:49:41 +0300 (MSK) > >Check contrib/tsearch2 and >http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2 >for documentation > > Oleg >On Fri, 7 Nov 2003, Martin Kuria wrote: > > > Hi, > > I have a content management system, for my database driven website >developed > > using php and postgresql but I don't know how to develop a search >facility > > for it. > > > > How do I go about it?. > > > > I have seen database driven website developed using php and postgresql >and > > they have their built search facilities where can I learn to develop my > > customized search facility please do advice. > > > > Kind Regards > > > > +-----------------------------------------------------+ > > | Martin W. Kuria (Mr.) martin.kuria@unon.org > > +----------------------------------------------------+ > > > > _________________________________________________________________ > > Tired of spam? Get advanced junk mail protection with MSN 8. > > http://join.msn.com/?page=features/junkmail > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 6: Have you searched our list archives? > > > > http://archives.postgresql.org > > > > Regards, > Oleg >_____________________________________________________________ >Oleg Bartunov, sci.researcher, hostmaster of AstroNet, >Sternberg Astronomical Institute, Moscow University (Russia) >Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ >phone: +007(095)939-16-83, +007(095)939-23-83 _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail