dbTalk Databases Forums  

[BUGS] Implicit conversion bugaboo in beta2?

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Implicit conversion bugaboo in beta2? in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Josh Berkus
 
Posts: n/a

Default [BUGS] Implicit conversion bugaboo in beta2? - 09-14-2003 , 11:57 PM






Guys,

got this problem in 7.4 beta 2:

treedemo=# SELECT LPAD ((team_name), (LENGTH(team_name) + (3*(tlevel-2)))) AS
teams_display,team_id, lnode
treedemo-# FROM teams
treedemo-# WHERE lnode > 0
treedemo-# ORDER BY lnode;
ERROR: function lpad(character varying, bigint) does not exist

(the above query worked fine in 7.3.4, as I recall)

treedemo=# \df lpad
List of functions
Result data type | Name | Argument data types
------------------+------+---------------------
text | lpad | text, integer
text | lpad | text, integer, text


Now, I've been in favor of reducing problematic implicit conversions. But
VARCHAR --> TEXT is one that needs to stay, as there's no possibility of
ambiguity, and most users count on doing it transparently.

Either that, or we need to build all string function for varchar.

--
Josh Berkus
Aglio Database Solutions
San Francisco

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

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Implicit conversion bugaboo in beta2? - 09-15-2003 , 12:35 AM






Josh Berkus <josh (AT) agliodbs (DOT) com> writes:
Quote:
Are we now defaulting COUNT(*) to BIGINT?
Uh, yeah, but we did in 7.2 and 7.3 as well... count() hasn't been
int4 since 7.1...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
  #3  
Old   
Josh Berkus
 
Posts: n/a

Default Re: [BUGS] Implicit conversion bugaboo in beta2? - 09-15-2003 , 12:55 AM



Tom,

Quote:
Uh, yeah, but we did in 7.2 and 7.3 as well... count() hasn't been
int4 since 7.1...
Hmmm ... can't be 7.2. The query is taken from a production database written
for 7.2; I'd have noticed the BIGINT problem before now. Either that, or in
7.2 we were doing implicit conversion from BIGINT to INT for function calls?

However, it's certainly possible it happend in 7.3, as this particular app was
not ported to 7.3.

--
Josh Berkus
Aglio Database Solutions
San Francisco

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

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
  #4  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Implicit conversion bugaboo in beta2? - 09-15-2003 , 01:00 AM



Josh Berkus <josh (AT) agliodbs (DOT) com> writes:
Quote:
Uh, yeah, but we did in 7.2 and 7.3 as well... count() hasn't been
int4 since 7.1...

Hmmm ... can't be 7.2. The query is taken from a production database written
for 7.2; I'd have noticed the BIGINT problem before now. Either that, or in
7.2 we were doing implicit conversion from BIGINT to INT for function calls?
That could be --- I don't recall exactly when we decided implicit
bigint->int conversion was a bad idea ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #5  
Old   
Josh Berkus
 
Posts: n/a

Default Re: [BUGS] Implicit conversion bugaboo in beta2? - 09-15-2003 , 01:18 AM



Tom,

Quote:
That could be --- I don't recall exactly when we decided implicit
bigint->int conversion was a bad idea ...
Well, it is a bad idea, so I won't argue. Sorry for the false alarm.

--
Josh Berkus
Aglio Database Solutions
San Francisco

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.