logo       

Re: weird situation, BUG or I'm not doing it right: msg#00345

Subject: Re: weird situation, BUG or I'm not doing it right
Ross,
You're exactly right, I re-created my table with text(may not seem elegant),
the problem is solved. Thanks to all of your advice, I can now go on with my
life with PostgreSQL. :)

jjw
8/25/2002

-----Original Message-----
From: pgsql-sql-owner@xxxxxxxxxxxxxx
[mailto:pgsql-sql-owner@xxxxxxxxxxxxxx]On Behalf Of Ross J. Reedstrom
Sent: Saturday, August 24, 2002 9:28 PM
To: Jiaqing Wang
Cc: pgsql-sql@xxxxxxxxxxxxxx
Subject: Re: [SQL] weird situation, BUG or I'm not doing it right


On Sat, Aug 24, 2002 at 10:56:31PM -0700, Jiaqing Wang wrote:
> Hello,
>
> I found below situation weird, it seems to me a bug.
>
> backend=> select * from valid_addr where state_abrev=upper('pr');
>  zip_code | city_name | state_abrev
> ----------+-----------+-------------
> (0 rows)
>
> while "select * from valid_addr where state_abrev='PR';" produces
following
> output
>
<20 lines of output>

You left out the critical piece: what's the schema for the table valid_addr?
I'll deduce that the column "state_abrev" is defined as something like
'char(4)'. It needs to be either char(2) (if _all_ state abbreviations are
guarenteed to be only 2) or as text. fixed with char fields are padded with
blanks. Not a bug, but an feature of the SQL standard.

Ross

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe