[SQL] Sql select like question.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SQL] Sql select like question.

tuanhoanganh
I use domain in my database
Ex
CREATE DOMAIN ud_id
  AS bpchar(3)
  DEFAULT ''::bpchar
  NOT NULL;

And have table A

CREATE TABLE A
(
    id ud_ma_nt NOT NULL,
    name ud_name,
    CONSTRAINT A_pkey PRIMARY KEY (id)
)

I have a select query Select * from A where id like 'US%'
In pgAdmin i have error : "ERROR:  unsupported type: 136452". But if select
is : Select * from A where id like 'US%'::ud_id, query work well.
So can I use first query in postgre? I don't want to use second query
because i don't know columns 's domain but i know it is char(xx).
Thank in advance. Sorry for my English.


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match
Reply | Threaded
Open this post in threaded view
|

Re: [SQL] Sql select like question.

Tom Lane-2
"hatuan" <[hidden email]> writes:
> I have a select query Select * from A where id like 'US%'
> In pgAdmin i have error : "ERROR:  unsupported type: 136452".

What PG version is this?

There were some bugs of that ilk in 8.0..8.0.2, but I think they
are all fixed in 8.0.3.  Leastwise your example doesn't fail for
me ...

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [SQL] Sql select like question.

tuanhoanganh
My version is "PostgreSQL 8.0.3 on i686-pc-mingw32, compiled by GCC gcc.exe
(GCC) 3.4.2 (mingw-special)"
----- Original Message -----
From: "Tom Lane" <[hidden email]>
To: "hatuan" <[hidden email]>
Cc: <[hidden email]>
Sent: Thursday, May 26, 2005 4:19 AM
Subject: Re: [SQL] Sql select like question.

> "hatuan" <[hidden email]> writes:
> > I have a select query Select * from A where id like 'US%'
> > In pgAdmin i have error : "ERROR:  unsupported type: 136452".
>
> What PG version is this?
>
> There were some bugs of that ilk in 8.0..8.0.2, but I think they
> are all fixed in 8.0.3.  Leastwise your example doesn't fail for
> me ...
>
> regards, tom lane


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Reply | Threaded
Open this post in threaded view
|

Re: [SQL] Sql select like question.

Tom Lane-2
"hatuan" <[hidden email]> writes:
> My version is "PostgreSQL 8.0.3 on i686-pc-mingw32, compiled by GCC gcc.exe
> (GCC) 3.4.2 (mingw-special)"

Well, if it's 8.0.3 then you've found a new variant of the problem, but
we cannot fix it without a complete test case.  Please read the bug
reporting guidelines:
http://www.postgresql.org/docs/8.0/static/bug-reporting.html

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org
Reply | Threaded
Open this post in threaded view
|

Re: [SQL] Sql select like question.

tuanhoanganh
In reply to this post by Tom Lane-2
I have fixed it. I have pg8.03 but database is 8.0. I dump database and
reload it, it work well.
Thank for your help.
----- Original Message -----
From: "Tom Lane" <[hidden email]>
To: "hatuan" <[hidden email]>
Cc: <[hidden email]>
Sent: Thursday, May 26, 2005 4:19 AM
Subject: Re: [SQL] Sql select like question.


> "hatuan" <[hidden email]> writes:
> > I have a select query Select * from A where id like 'US%'
> > In pgAdmin i have error : "ERROR:  unsupported type: 136452".
>
> What PG version is this?
>
> There were some bugs of that ilk in 8.0..8.0.2, but I think they
> are all fixed in 8.0.3.  Leastwise your example doesn't fail for
> me ...
>
> regards, tom lane


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [hidden email])