473,395 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

text + text

What is "text + text" supposed to do right now? It doesn't seem very
useful to me. What about making "text + text" as an equivalent for "text
|| text"? Most strongly-typed programming languages do this. And MS SQL
Server too, I think (CMIIW).

--
dave
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #1
4 1945
Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond:
What is "text + text" supposed to do right now?
Nothing.
What about making "text + text" as an equivalent for "text
|| text"? Most strongly-typed programming languages do this. And MS SQL
Server too, I think (CMIIW).


What would this gain except for bloat? It's not like SQL is utterly
compatible with any programming language; users will still have to learn all
the operators anyway.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #2
Peter Eisentraut wrote:
What is "text + text" supposed to do right now?


Nothing.


Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly,
the current behaviour is quite strange to me.

------------------
=# select coalesce('1'+'0','NULL');
a
=# select coalesce('1'+'1','NULL');
b
=# select coalesce('1'+'3','NULL');
d
=# select coalesce('a'+'0','NULL');

=# select coalesce('a'+'1','NULL');

=# select coalesce('a'+'3','NULL');

=# select coalesce('a'+'x','NULL');
Ù
------------------
What about making "text + text" as an equivalent for "text
|| text"? Most strongly-typed programming languages do this. And MS SQL
Server too, I think (CMIIW).


What would this gain except for bloat? It's not like SQL is utterly
compatible with any programming language; users will still have to learn all
the operators anyway.


I personally don't consider this "bloat". We already have other synonyms
like '!=' and '<>'. '+' is very natural to mean concatenation for strings.

Anyway, either emitting an error or string concatenation is better than
the current behaviour, I think.

--
dave

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #3
On Fri, 8 Oct 2004, David Garamond wrote:
Peter Eisentraut wrote:
What is "text + text" supposed to do right now?


Nothing.


Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly,
the current behaviour is quite strange to me.

------------------
=# select coalesce('1'+'0','NULL');
a


That isn't text+text. It's "char"+"char". "char" is a rather bizarre type
being partially 1 byte integer and partially 1 character string and it
causes strange behaviors like the above where I believe it's taking the
first bytes of the '1' and '0' and adding them together. I think Tom was
talking about removing the math operators from it so that things like the
above don't happen.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #4
David Garamond <li***@zara.6.isreserved.com> writes:
Peter Eisentraut wrote:
What is "text + text" supposed to do right now?
Nothing.

Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly,
the current behaviour is quite strange to me.


CVS tip gives

regression=# select coalesce('1'+'0','NULL');
ERROR: operator is not unique: "unknown" + "unknown"
HINT: Could not choose a best candidate operator. You may need to add explicit type casts.
regression=#

See http://archives.postgresql.org/pgsql...0/msg00041.php

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: joes | last post by:
Hello there ! I rendering a PDF with XSLT using Xalan and FOP. I like to place in my article an image, so that the text is floating around the image. I tried several things but it didn't work so...
3
by: Xerxes | last post by:
Hi, I need help in setting up a page where the text wraps around an image. Right now, I am using table, with text in one <td> and the image in the adjacent <td>. The problem is when the text is...
2
by: Macsicarr | last post by:
Hi All Wonder if you could help me. I have created a CMS system that allows the user to enter text and pic 'tags' for their own About us page, eg text.... text.... text.... text.......
2
by: Jiri Palecek | last post by:
I have a question on web authoring (probably HTML+CSS). Is it somehow possible to put two words above each other inside a paragraph so the result would be valid and render at least in Mozilla? I...
4
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
3
by: jweinberg1975 | last post by:
I would like for users to be able to select from a small number of options that come from a little drop down menu which then closes. .....
3
by: bbepristis | last post by:
Hey all I have this code that reads from one text file writes to another unless im on a certian line then it writes the new data however it only seems to do about 40 lines then quits and I cant...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
3
by: jonniethecodeprince | last post by:
Hi all, I have trouble getting an array of data stored in a separate javascript file i.e. a file called books.js into a table of data for a .xhtml file. There are 50 Records in this file....
10
by: bluemountain | last post by:
Hi there, Iam new to python forms and programming too I had a text file where i need to extract few words of data from the header(which is of 3 lines) and search for the keyword TEXT1, TEXT2,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.