I agree with you, but...

Actually that's not how the compare works usually.

Generally one of the operands is converted to the same datatype as the other, and THEN the compare is performed.

I expect MS SQL is converting a 'sdas' typeless string to be assumed CHAR and Postgresql is converting a 'sdas' typeless string to be assumed VARCHAR.

Hence, the different behaviour.

Terry

Dann Corbit wrote:
Would you want varchar(30) 'Dann Corbit' to compare equal to bpchar(30)
'Dann Corbit'?

I would.
If both are considered character types by the language, then they must
compare that way.

Perhaps there are some nuances that I am not aware of.  But that is how
things ought to behave, if I were king of the forest.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:pgsql-general-
[EMAIL PROTECTED] On Behalf Of Terry Fielder
Sent: Wednesday, October 19, 2005 12:37 PM
To: Marc G. Fournier
Cc: [EMAIL PROTECTED]; pgsql-general@postgresql.org
Subject: Re: [pgsql-advocacy] [GENERAL] Oracle buys Innobase

OK, I am not an expert on the SQL standard, but I thought the

definition

varied by data type e.g. varchar <> bpchar

Terry

Marc G. Fournier wrote:

On Wed, 19 Oct 2005, [EMAIL PROTECTED] wrote:


I was referring to trailing blanks, but did not explicitly say it,
though showed it in the examples.  I am pretty sure that the SQL
standard says that trailing whitespace is insignificant in string
comparison.


Then we are broken too :)

# select 'a ' = 'a  ';
?column?
----------
f
(1 row)

----
Marc G. Fournier           Hub.Org Networking Services

(http://www.hub.org)

Email: [EMAIL PROTECTED]           Yahoo!: yscrappy              ICQ:

7615664

---------------------------(end of

broadcast)---------------------------

TIP 4: Have you searched our list archives?

             http://archives.postgresql.org


--
Terry Fielder
[EMAIL PROTECTED]
Associate Director Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
Fax: (416) 441-9085

---------------------------(end of

broadcast)---------------------------

TIP 6: explain analyze is your friend



--
Terry Fielder
[EMAIL PROTECTED]
Associate Director Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
Fax: (416) 441-9085

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

              http://www.postgresql.org/docs/faq

Reply via email to