[GENERAL] Get closest numbers between intervals

2009-09-01 Thread xaviergxf
Hi,

   I have one table that has this structure:

city_code, start_ip, end_ip

I´m searching for the city that its between two ip´s. But, i would
like to get the nearest´s cities too.

Any ideas how can i search for the city proximity?

thanks!

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Creating index for convert text to integer

2009-08-26 Thread xaviergxf
Hi,

  How can i create a index to index all the fields that has the type
INTEGER, in the following table:

create type properties_types as enum('INTEGER', 'STRING', 'FLOAT');

create table properties_types(
   value text NOT NULL,
   value_type properties_types NOT NULL
);

insert into properties_types values('1', 'INTEGER');
insert into properties_types values('2', 'INTEGER');
insert into properties_types values('3', 'INTEGER');
insert into properties_types values('4', 'INTEGER');

how do i create index for the integer types?

create index properties_types_index on properties_types
((value ::integer)) where value_type='INTEGER'


Can i use this select with the index?
select valor from properties_types where value::integer<3



Thanks!



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Improving Full text performance

2009-08-22 Thread xaviergxf
If i strip all html tags and filter more stop words, will the search
be more accurate? Actually my fulltext stats returns some like: font
from  tags i guess, and other garbage.
 If i do that, will i improve the speed of my search?

Thanks!

Ps: I cannot use other tools like MNOsearch, lucene, etc...because i
have no root pass to my server.

On 22 ago, 02:20, o...@sai.msu.su (Oleg Bartunov) wrote:
> On Fri, 21 Aug 2009, xaviergxf wrote:
> > Hi,
>
> >   I?m using php and full text on postgresql 8.3 for indexing html
> > descriptions. I have no acess to postgresql server, since i use a
> > shared hosting service.
> >    To improve search and performance, i want to do the follow:
>
> > Strip all html tags then use my php script to remove more stop words
> > (because i can?t edit stop words file on the server).
>
> > My question: What i?m thinking to do, has any collateral effects? Any
> > suggestions?
>
> You shouldn't bother to strip all html tags, just create your own text search
> configuration, which index only what do you want. Read documentation for
> details.
>
>         Regards,
>                 Oleg
> _
> Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
> Sternberg Astronomical Institute, Moscow University, Russia
> Internet: o...@sai.msu.su,http://www.sai.msu.su/~megera/
> phone: +007(495)939-16-83, +007(495)939-23-83
>
> --
> Sent via pgsql-general mailing list (pgsql-gene...@postgresql.org)
> To make changes to your 
> subscription:http://www.postgresql.org/mailpref/pgsql-general


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Improving Full text performance

2009-08-21 Thread xaviergxf
Hi,


   I´m using php and full text on postgresql 8.3 for indexing html
descriptions. I have no acess to postgresql server, since i use a
shared hosting service.
To improve search and performance, i want to do the follow:

Strip all html tags then use my php script to remove more stop words
(because i can´t edit stop words file on the server).

My question: What i´m thinking to do, has any collateral effects? Any
suggestions?

Thanks!

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] TSearch2 Searching Text with Synonyms and Stop Dictionary

2008-05-08 Thread xaviergxf
Hi,


  I´m trying to use the tsearch2 with postgre 8.2. What i am trying to
do its: from a text search the text and synonyms excluding the words
that doesn´t mean nothing like("what", "the", "of").
  How can i configure the dictionarys for use both synonyms and stop
dictionarys?
  Can anyone create a function that do that?
  I´m using the portuguese dictionarys at
http://snowball.tartarus.org/algorithms/portuguese/stemmer.html.


Thanks very much


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Postgresql installation - cannot initdb 1

2008-04-26 Thread xaviergxf
Hi,

I had the postgresql version 8.2, but i´ve updated it to the 8.3.
During the installation, postresql show this message "Failed to run
initdb: 1". I already tried to remove and reinstall, but it does not
works.

Did anyone know how can i solve this problem?

Thanks

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Table with differerent Data Types

2008-04-26 Thread xaviergxf
hi, i haven´t found the explication about my problem...


On 24 abr, 03:04, [EMAIL PROTECTED] (Klint Gore) wrote:
> xaviergxf wrote:
> > Hi,
>
> >    I´m trying to do the follow: create a table like:
> > create table t(
> >   cod serial,
> >   data_type char(10),
> >   value ???
> > );
>
> > I would like to do the follow the table would tell me what data type
> > its the value. For instance:
>
> > insert into t values(1, 'Integer', 12);
> > insert into t values(2, 'String', 'test');
> > insert into t values(3, 'Float', 1.23);
>
> > How can i do that? Its that possible? How Can i solve this problem?
>
> seehttp://www.varlena.com/varlena/GeneralBits/110.php
>
> klint.
>
> --
> Klint Gore
> Database Manager
> Sheep CRC
> A.G.B.U.
> University of New England
> Armidale NSW 2350
>
> Ph: 02 6773 3789  
> Fax: 02 6773 3266
> EMail: [EMAIL PROTECTED]
>
> --
> Sent via pgsql-general mailing list ([EMAIL PROTECTED])
> To make changes to your 
> subscription:http://www.postgresql.org/mailpref/pgsql-general- Ocultar texto 
> entre aspas -
>
> - Mostrar texto entre aspas -


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Table with differerent Data Types

2008-04-23 Thread xaviergxf
Hi,


   I´m trying to do the follow: create a table like:
create table t(
  cod serial,
  data_type char(10),
  value ???
);

I would like to do the follow the table would tell me what data type
its the value. For instance:

insert into t values(1, 'Integer', 12);
insert into t values(2, 'String', 'test');
insert into t values(3, 'Float', 1.23);

How can i do that? Its that possible? How Can i solve this problem?


Thanks a lot

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general