Hmmm, I ran the query straight from the docs and the columns are of type
'integer'.
mail=# \d users
Table "public.users"
Column | Type | Modifiers
-----------+------------------------+----------------------------------------------------
id | integer | not null default
nextval('users_id_seq'::regclass)
priority | integer | not null default 7
policy_id | integer | not null default 1
email | bytea | not null
fullname | character varying(255) | default NULL::character varying
local | character(1) |
<snip>
mail=# \d policy
Table "public.policy"
Column | Type |
Modifiers
------------------------------+-----------------------+-----------------------------------------------------
id | integer | not null default
nextval('policy_id_seq'::regclass)
policy_name | character varying(32) |
This query runs fine from psql . . . . . . . .
SELECT policy.*,users.* FROM users,policy
WHERE (users.policy_id=policy.id) AND (users.email IN ('[email protected]'))
ORDER BY users.priority DESC
I tried putting escaped single quotes around the (%k) but that just caused some
other "placeholder to bind with" error.
HEY, it's the email column -- which is bytea --- on my other amavis server it's
character varying 255 . . . . why the change?
--- On Wed, 6/10/09, Mark Martinec <[email protected]> wrote:
> From: Mark Martinec <[email protected]>
> Subject: Re: [AMaViS-user] 2.6.3 with Postgres causing "ERROR: operator does
> not exist: bytea = character varying"
> To: [email protected]
> Date: Wednesday, June 10, 2009, 10:31 AM
> Brian,
>
> > There's a good chance that I've misconfigured
> something, but I'm at a loss
> > for direction.
>
> > amavis[6032]: (06032-01) (!)lookup_sql: sql exec:
> err=7, 25P01, DBD::Pg::st
> > execute failed: ERROR: operator does not exist:
> bytea = character
> > varying\nLINE 1: ...HERE (users.policy_id=policy.id)
> AND (users.email IN
> > ($1,$2,...\n
>
>
>
> > ^\nHINT: No operator matches the given name and
> argument type(s). You
> > might need to add explicit type casts. at (eval 97)
> line 166, <GEN13> line
> > 5., 7, ERROR: operator does not exist: bytea =
> character varying\nLINE 1:
> > ...HERE (users.policy_id=policy.id) AND (users.email
> IN ($1,$2,...\n
> >
>
>
> ^\nHINT: No operator
> > matches the given name and argument type(s). You might
> need to add explicit
> > type casts.
>
> Seems your field users.policy_id is of type 'bytea',
> while policy.id is 'character varying'. They should
> be of the same data type. It would be more common
> to let both be integers, but string is probably alright
> too, as long as both are of the same type.
>
> Mark
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables
> unlimited
> royalty-free distribution of the report engine for
> externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> AMaViS-user mailing list
> [email protected]
>
> https://lists.sourceforge.net/lists/listinfo/amavis-user
>
> AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
> AMaViS-HowTos:http://www.amavis.org/howto/
>
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/