Re: [SQL] Division in Postgre

2005-05-01 Thread hatuan
Thank you
- Original Message -
From: "Stephan Szabo" <[EMAIL PROTECTED]>
To: "tuan" <[EMAIL PROTECTED]>
Cc: 
Sent: Saturday, April 30, 2005 10:56 AM
Subject: Re: [SQL] Division in Postgre


> On Sun, 24 Apr 2005, tuan wrote:
>
> > In sql server my division select cast(3 as float)/10 is 0.299.
> > But in postgres select cast(3 as float8)/10 is 0.3. How to get result
like
> > sql server?
>
> I believe you can control what precision is used in printing the float
> results with extra_float_digits. I believe setting it to 2 will give a
> 0.29... result however it has more 9s than the above.
>
>
> ---(end of broadcast)---
> TIP 3: if posting/reading through Usenet, please send an appropriate
>   subscribe-nomail command to [EMAIL PROTECTED] so that your
>   message can get through to the mailing list cleanly


---(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


[SQL] Sql select like question.

2005-05-25 Thread hatuan
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


Re: [SQL] Sql select like question.

2005-05-26 Thread hatuan
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" <[EMAIL PROTECTED]>
To: "hatuan" <[EMAIL PROTECTED]>
Cc: 
Sent: Thursday, May 26, 2005 4:19 AM
Subject: Re: [SQL] Sql select like question.
> "hatuan" <[EMAIL PROTECTED]> 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


Re: [SQL] Sql select like question.

2005-05-26 Thread hatuan
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" <[EMAIL PROTECTED]>
To: "hatuan" <[EMAIL PROTECTED]>
Cc: 
Sent: Thursday, May 26, 2005 4:19 AM
Subject: Re: [SQL] Sql select like question.


> "hatuan" <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED])