Skip to main content
deleted 9 characters in body
Source Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496

Hello I have a postgresql question about searching on zip codes. Basicly, if I do a:

select * from my_table where zip_ = '90210';

I am returned 0 rows. I know for a fact that there is thousands of rows with that zip code. The table itself is over a million rows.

    Column        |       Type        |                      Modifiers                      
---------------------+-------------------+-----------------------------------------------------
...
 zip_                | character varying | 

Here is my table and I am not able to search effectively on zip_ column. The table does return a search if I use the like keyword along with % char, but that is not what I need.

my questions are:

  • why when i search on zip_ lets say '90210' it comes back with 0 rows when I know there is thousands of records with the zip code of '90210'?
  • if i change the type to int would that make a difference?
  • do i need an index on the zip_ column?

Hello I have a postgresql question about searching on zip codes. Basicly, if I do a:

select * from my_table where zip_ = '90210';

I am returned 0 rows. I know for a fact that there is thousands of rows with that zip code. The table itself is over a million rows.

    Column        |       Type        |                      Modifiers                      
---------------------+-------------------+-----------------------------------------------------
...
 zip_                | character varying | 

Here is my table and I am not able to search effectively on zip_ column. The table does return a search if I use the like keyword along with % char, but that is not what I need.

my questions are:

  • why when i search on zip_ lets say '90210' it comes back with 0 rows when I know there is thousands of records with the zip code of '90210'?
  • if i change the type to int would that make a difference?
  • do i need an index on the zip_ column?

Hello I have a postgresql question about searching on zip codes. Basicly, if I do a:

select * from my_table where zip_ = '90210';

I am returned 0 rows. I know for a fact that there is thousands of rows with that zip code. The table itself is over a million rows.

    Column        |       Type        |                      Modifiers                      
---------------------+-------------------+-----------------------------------------------------
...
 zip_             | character varying | 

Here is my table and I am not able to search effectively on zip_ column. The table does return a search if I use the like keyword along with % char, but that is not what I need.

my questions are:

  • why when i search on zip_ lets say '90210' it comes back with 0 rows when I know there is thousands of records with the zip code of '90210'?
  • if i change the type to int would that make a difference?
  • do i need an index on the zip_ column?
deleted 617 characters in body
Source Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496

Hello I have a postgresql question about searching on zip codes. Basicly, if I do a:

select * from my_table where zip_ = '90210';

I am returned 0 rows. I know for a fact that there is thousands of rows with that zip code. The table itself is over a million rows.

    Column        |       Type        |                      Modifiers                      
---------------------+-------------------+-----------------------------------------------------
 id                  | integer           | not null default nextval('rest_link_seq'::regclass)
 rest_name           | character varying | 
 rest_link           | character varying | 
 thumbnail_img       | character varying | 
 menu_available      | boolean           | 
 text_menu_available | boolean           | 
 city_name           | character varying | 
 neighborhood_name   | character varying | 
 phone               | character varying | 
 address             | character varying | 
 city_               | character varying | 
 state_              | character varying | ...
 zip_                | character varying | 
 website             | character varying | 

Here is my table and I am not able to search effectively on zip_ column. The The table does return a search if I use the like keyword along with % char, but that is not what I need.

my questions are:

  • why when i search on zip_ lets say '90210' it comes back with 0 rows when I know there is thousands of records with the zip code of '90210'?
  • if i change the type to int would that make a difference?
  • do i need an index on the zip_ column?

Thanks

Hello I have a postgresql question about searching on zip codes. Basicly, if I do a:

select * from my_table where zip_ = '90210';

I am returned 0 rows. I know for a fact that there is thousands of rows with that zip code. The table itself is over a million rows.

    Column        |       Type        |                      Modifiers                      
---------------------+-------------------+-----------------------------------------------------
 id                  | integer           | not null default nextval('rest_link_seq'::regclass)
 rest_name           | character varying | 
 rest_link           | character varying | 
 thumbnail_img       | character varying | 
 menu_available      | boolean           | 
 text_menu_available | boolean           | 
 city_name           | character varying | 
 neighborhood_name   | character varying | 
 phone               | character varying | 
 address             | character varying | 
 city_               | character varying | 
 state_              | character varying | 
 zip_                | character varying | 
 website             | character varying | 

Here is my table and I am not able to search effectively on zip_ column. The table does return a search if I use the like keyword along with % char, but that is not what I need.

my questions are:

  • why when i search on zip_ lets say '90210' it comes back with 0 rows when I know there is thousands of records with the zip code of '90210'?
  • if i change the type to int would that make a difference?
  • do i need an index on the zip_ column?

Thanks

Hello I have a postgresql question about searching on zip codes. Basicly, if I do a:

select * from my_table where zip_ = '90210';

I am returned 0 rows. I know for a fact that there is thousands of rows with that zip code. The table itself is over a million rows.

    Column        |       Type        |                      Modifiers                      
---------------------+-------------------+-----------------------------------------------------
...
 zip_                | character varying | 

Here is my table and I am not able to search effectively on zip_ column. The table does return a search if I use the like keyword along with % char, but that is not what I need.

my questions are:

  • why when i search on zip_ lets say '90210' it comes back with 0 rows when I know there is thousands of records with the zip code of '90210'?
  • if i change the type to int would that make a difference?
  • do i need an index on the zip_ column?
Source Link

Not able to search on zipcode column a table in postgresql

Hello I have a postgresql question about searching on zip codes. Basicly, if I do a:

select * from my_table where zip_ = '90210';

I am returned 0 rows. I know for a fact that there is thousands of rows with that zip code. The table itself is over a million rows.

    Column        |       Type        |                      Modifiers                      
---------------------+-------------------+-----------------------------------------------------
 id                  | integer           | not null default nextval('rest_link_seq'::regclass)
 rest_name           | character varying | 
 rest_link           | character varying | 
 thumbnail_img       | character varying | 
 menu_available      | boolean           | 
 text_menu_available | boolean           | 
 city_name           | character varying | 
 neighborhood_name   | character varying | 
 phone               | character varying | 
 address             | character varying | 
 city_               | character varying | 
 state_              | character varying | 
 zip_                | character varying | 
 website             | character varying | 

Here is my table and I am not able to search effectively on zip_ column. The table does return a search if I use the like keyword along with % char, but that is not what I need.

my questions are:

  • why when i search on zip_ lets say '90210' it comes back with 0 rows when I know there is thousands of records with the zip code of '90210'?
  • if i change the type to int would that make a difference?
  • do i need an index on the zip_ column?

Thanks