~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/test/regress/sql/text.sql

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- TEXT
 
3
--
 
4
 
 
5
SELECT text 'this is a text string' = text 'this is a text string' AS true;
 
6
 
 
7
SELECT text 'this is a text string' = text 'this is a text strin' AS false;
 
8
 
 
9
CREATE TABLE TEXT_TBL (f1 text);
 
10
 
 
11
INSERT INTO TEXT_TBL VALUES ('doh!');
 
12
INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
 
13
 
 
14
SELECT '' AS two, * FROM TEXT_TBL;
 
15
 
 
16
-- As of 8.3 we have removed most implicit casts to text, so that for example
 
17
-- this no longer works:
 
18
 
 
19
select length(42);
 
20
 
 
21
-- But as a special exception for usability's sake, we still allow implicit
 
22
-- casting to text in concatenations, so long as the other input is text or
 
23
-- an unknown literal.  So these work:
 
24
 
 
25
select 'four: '::text || 2+2;
 
26
select 'four: ' || 2+2;
 
27
 
 
28
-- but not this:
 
29
 
 
30
select 3 || 4.0;