Unix Technical Forum

String concat issues in 8.3.1 (8.3.1 bug?)

This is a discussion on String concat issues in 8.3.1 (8.3.1 bug?) within the Pgsql General forums, part of the PostgreSQL category; --> I have a table as follows: \d test_dim Table "public.test_dim" Column | Type | Modifiers -----------------+-----------------------------+------------------------ customer_srcid | bigint ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 05:10 PM
kevin kempter
 
Posts: n/a
Default String concat issues in 8.3.1 (8.3.1 bug?)

I have a table as follows:

\d test_dim
Table "public.test_dim"
Column | Type | Modifiers
-----------------+-----------------------------+------------------------
customer_srcid | bigint | not null
segment_srcid | bigint | not null
show_name | character varying(500) | not null
create_dt | timestamp without time zone | not null default now()


I have this table in a db on an 8.2.6 cluster and in another db on an
8.3.1 cluster.

In both clusters I can do the following:


# select customer_srcid, segment_srcid from test_dim;
customer_srcid | segment_srcid
----------------+---------------
1 | 1
1 | 2
1 | 3
1 |
1 |
1 |
1 | 1
1 | 2
1 | 3
1 |
1 |
1 |
1 | 1
1 | 2
1 | 3
1 |
1 |
1 |
1 | 1
1 | 2
1 | 3
1 |
1 |
1 |
(24 rows)



In version 8.2.6 I can do this:

# select customer_srcid || segment_srcid from test_dim;
?column?
----------
11
12
13



11
12
13



11
12
13



11
12
13



(24 rows)




However in the 8.3.1 cluster I get this (Both clusters have the same
data set - via a pg_dump):

# select customer_srcid || segment_srcid from test_dim;
ERROR: operator does not exist: bigint || bigint
LINE 1: select customer_srcid || segment_srcid from sl_segment_dim;
^
HINT: No operator matches the given name and argument type(s). You
might need to add explicit type casts.




Thoughts ?



Thanks in advance


/Kevin




--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 05:10 PM
Richard Huxton
 
Posts: n/a
Default Re: String concat issues in 8.3.1 (8.3.1 bug?)

kevin kempter wrote:
> I have a table as follows:
>
> \d test_dim
> Table "public.test_dim"
> Column | Type | Modifiers
> -----------------+-----------------------------+------------------------
> customer_srcid | bigint | not null
> segment_srcid | bigint | not null
> show_name | character varying(500) | not null
> create_dt | timestamp without time zone | not null default now()
>
>
> I have this table in a db on an 8.2.6 cluster and in another db on an
> 8.3.1 cluster.
>
> In both clusters I can do the following:
>
>
> # select customer_srcid, segment_srcid from test_dim;
> customer_srcid | segment_srcid
> ----------------+---------------
> 1 | 1
> 1 | 2
> 1 | 3
> 1 |
> 1 |
> 1 |


Are you sure the definition has "not null" on it?

> In version 8.2.6 I can do this:
>
> # select customer_srcid || segment_srcid from test_dim;
> ?column?
> ----------
> 11
> 12
> 13


> However in the 8.3.1 cluster I get this (Both clusters have the same
> data set - via a pg_dump):
>
> # select customer_srcid || segment_srcid from test_dim;
> ERROR: operator does not exist: bigint || bigint
> LINE 1: select customer_srcid || segment_srcid from sl_segment_dim;
> ^
> HINT: No operator matches the given name and argument type(s). You
> might need to add explicit type casts.


Some of the implicit typecasting has been tightened up in 8.3 - try
casting to text first.

SELECT customer_srcid::text || segment_srcid::text ...

--
Richard Huxton
Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 05:10 PM
A. Kretschmer
 
Posts: n/a
Default Re: String concat issues in 8.3.1 (8.3.1 bug?)

am Thu, dem 17.04.2008, um 3:05:14 -0600 mailte kevin kempter folgendes:
> However in the 8.3.1 cluster I get this (Both clusters have the same
> data set - via a pg_dump):
>
> # select customer_srcid || segment_srcid from test_dim;
> ERROR: operator does not exist: bigint || bigint
> LINE 1: select customer_srcid || segment_srcid from sl_segment_dim;
> ^
> HINT: No operator matches the given name and argument type(s). You
> might need to add explicit type casts.
>
>
>
>
> Thoughts ?


You have to cast int-values to text, untested:

select customer_srcid::text || segment_srcid::text ...



Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:52 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com