Thread: Sql select like question.

Sql select like question.

From
"hatuan"
Date:
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.



Re: Sql select like question.

From
Tom Lane
Date:
"hatuan" <hatuan05@gmail.com> 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


Re: Sql select like question.

From
"hatuan"
Date:
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" <tgl@sss.pgh.pa.us>
To: "hatuan" <hatuan05@gmail.com>
Cc: <pgsql-sql@postgresql.org>
Sent: Thursday, May 26, 2005 4:19 AM
Subject: Re: [SQL] Sql select like question.
> "hatuan" <hatuan05@gmail.com> 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



Re: Sql select like question.

From
Tom Lane
Date:
"hatuan" <hatuan05@gmail.com> 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


Re: Sql select like question.

From
"hatuan"
Date:
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" <tgl@sss.pgh.pa.us>
To: "hatuan" <hatuan05@gmail.com>
Cc: <pgsql-sql@postgresql.org>
Sent: Thursday, May 26, 2005 4:19 AM
Subject: Re: [SQL] Sql select like question.


> "hatuan" <hatuan05@gmail.com> 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