From: | Roland Roberts <roberts(at)panix(dot)com> |
---|---|
To: | pgsql-bugs(at)postgreSQL(dot)org, hackers(at)postgreSQL(dot)org |
Subject: | Postgres 6.3.2 varchar <--> int4 conversions |
Date: | 1999-01-14 01:52:36 |
Message-ID: | m3iuea1uzf.fsf@ptolemy.rlent.pnet |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs pgsql-hackers |
-----BEGIN PGP SIGNED MESSAGE-----
I recently had a query fail with the following error:
keystone=> select members.id, members.element, slips.sid, slips.problem
keystone-> from slips, members
keystone-> where members.element = slips.sid
keystone-> and members.id = 'quickslips';
ERROR: There is no operator '=' for types 'varchar' and 'int4'
You will either have to retype this query using an explicit cast,
or you will have to define the operator using CREATE OPERATOR
casting the varchar column to int4 works, but if I try to cast the
int4 to varchar I get another error:
keystone=> select members.id, members.element, slips.sid, slips.problem
keystone-> from slips, members
keystone-> where members.element = varchar(slips.sid)
keystone-> and members.id = 'quickslips';
ERROR: parser: parse error at or near "slips"
I would expect that the int4 --> varchar conversion would be the
"safer" one to do. By "safer" I mean that an int4 value should map to
a distinct varchar value whereas all non-numeric varchar values
generate an error in pg_atoi....
roland
- --
PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD Custom Software Solutions
roberts(at)panix(dot)com 101 West 15th St #4NN
rbroberts(at)acm(dot)org New York, NY 10011
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
iQCVAwUBNp1N4uoW38lmvDvNAQG/PAQAr1eU8jG6lsfFACxb732mFA/rnxKkKIED
bn0t3AbAZMMyWe1GajQ5iEXz3ZrZmQGgGS05WMtLyo6HF/Zxvdj235qSJFVsucC3
nQR/knEO+we3/PUCiqKEPPZNkufCxhyFjFEctws1wcp5XDnrO3EiYTBC5vTUXNF1
1nW+k38StyU=
=gWkW
-----END PGP SIGNATURE-----
From | Date | Subject | |
---|---|---|---|
Next Message | Javier Kohen | 1999-01-14 09:32:18 | create view foo as select avg(x), avg(y) from bar; "ERROR: attribute 'avg' duplicated" BUG or FEATURE? |
Previous Message | Unprivileged user | 1999-01-12 02:37:11 | General Bug Report: Incorrect subtraction - rounding error - should NOT round! |
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas G. Lockhart | 1999-01-14 06:11:02 | Re: [HACKERS] SUM() and GROUP BY |
Previous Message | Tom Lane | 1999-01-14 00:22:46 | Re: [HACKERS] pg_dump again |