Lists: | pgsql-general |
---|
From: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 18:20:56 |
Message-ID: | 4C000988.8070807@sensacd.com.mx |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
hi!
only for ask, there is a way to deactivate type validation, so i can do
select rtrim(number_field) from table ; with no error and the
message: "You might need to explicit type casts"
this is postgres 8.3.1.
From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 18:26:41 |
Message-ID: | 4C000AE1.4040006@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On 05/28/2010 11:20 AM, erobles wrote:
> hi!
> only for ask, there is a way to deactivate type validation, so i can do
>
> select rtrim(number_field) from table ; with no error and the message:
> "You might need to explicit type casts"
>
> this is postgres 8.3.1.
>
What are you trying to do? I am trying to think what rtrim does on a number.
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
From: | Bill Moran <wmoran(at)potentialtech(dot)com> |
---|---|
To: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
Cc: | erobles <erobles(at)sensacd(dot)com(dot)mx>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 18:34:31 |
Message-ID: | 20100528143431.f9527fc5.wmoran@potentialtech.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
In response to Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>:
> On 05/28/2010 11:20 AM, erobles wrote:
> > hi!
> > only for ask, there is a way to deactivate type validation, so i can do
> >
> > select rtrim(number_field) from table ; with no error and the message:
> > "You might need to explicit type casts"
> >
> > this is postgres 8.3.1.
> >
>
> What are you trying to do? I am trying to think what rtrim does on a number.
It doesn't work on numbers, which is why he gets the "need type casts" error.
Direct answer to the question: no, there is no way to disable type validation,
it's a core feature and it wouldn't make sense.
Solution to your problem:
select rtrim(CAST(number_field AS TEXT)) from table;
Although I can't imagine why you'd be trying to trim whitespace from a
numeric field ... it will never have whitespace.
--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/
From: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
---|---|
To: | |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 18:45:38 |
Message-ID: | 4C000F52.5020703@sensacd.com.mx |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On 05/28/2010 01:26 PM, Adrian Klaver wrote:
> On 05/28/2010 11:20 AM, erobles wrote:
>> hi!
>> only for ask, there is a way to deactivate type validation, so i can do
>>
>> select rtrim(number_field) from table ; with no error and the message:
>> "You might need to explicit type casts"
>>
>> this is postgres 8.3.1.
>>
>
> What are you trying to do? I am trying to think what rtrim does on a
> number.
>
you are right, i'm trying to make a rtrim to a number.
the reason of my question is we have a lot of apps with similar
querys , when we have postgres7.2 this kind of querys just simply
execute very well, so.. when change to postgres 8.3 this querys fail
beacuse they needit an explicit cast.
one solution is change the querys of apps and recompile, but time is
short and the deadline is near.
other solution is create a function to each explicit cast, but we
dont have the time to research if there are more mismatch querys.
so the easy way is deactivate the validation type ...
so another
From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 18:51:04 |
Message-ID: | 4C001098.8070808@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On 05/28/2010 11:45 AM, erobles wrote:
>
>
> On 05/28/2010 01:26 PM, Adrian Klaver wrote:
>> On 05/28/2010 11:20 AM, erobles wrote:
>>> hi!
>>> only for ask, there is a way to deactivate type validation, so i can do
>>>
>>> select rtrim(number_field) from table ; with no error and the message:
>>> "You might need to explicit type casts"
>>>
>>> this is postgres 8.3.1.
>>>
>>
>> What are you trying to do? I am trying to think what rtrim does on a
>> number.
>>
>
>
> you are right, i'm trying to make a rtrim to a number.
> the reason of my question is we have a lot of apps with similar querys ,
> when we have postgres7.2 this kind of querys just simply execute very
> well, so.. when change to postgres 8.3 this querys fail beacuse they
> needit an explicit cast.
>
> one solution is change the querys of apps and recompile, but time is
> short and the deadline is near.
>
> other solution is create a function to each explicit cast, but we dont
> have the time to research if there are more mismatch querys.
>
> so the easy way is deactivate the validation type ...
>
>
>
>
>
> so another
>
For short term solution see here:
http://petereisentraut.blogspot.com/2008/03/readding-implicit-casts-in-postgresql.html
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
From: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
---|---|
To: | |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 19:04:45 |
Message-ID: | 4C0013CD.20002@sensacd.com.mx |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On 05/28/2010 01:51 PM, Adrian Klaver wrote:
> On 05/28/2010 11:45 AM, erobles wrote:
>>
>>
>> On 05/28/2010 01:26 PM, Adrian Klaver wrote:
>>> On 05/28/2010 11:20 AM, erobles wrote:
>>>> hi!
>>>> only for ask, there is a way to deactivate type validation, so i
>>>> can do
>>>>
>>>> select rtrim(number_field) from table ; with no error and the message:
>>>> "You might need to explicit type casts"
>>>>
>>>> this is postgres 8.3.1.
>>>>
>>>
>>> What are you trying to do? I am trying to think what rtrim does on a
>>> number.
>>>
>>
>>
>> you are right, i'm trying to make a rtrim to a number.
>> the reason of my question is we have a lot of apps with similar querys ,
>> when we have postgres7.2 this kind of querys just simply execute very
>> well, so.. when change to postgres 8.3 this querys fail beacuse they
>> needit an explicit cast.
>>
>> one solution is change the querys of apps and recompile, but time is
>> short and the deadline is near.
>>
>> other solution is create a function to each explicit cast, but we dont
>> have the time to research if there are more mismatch querys.
>>
>> so the easy way is deactivate the validation type ...
>>
>>
>>
>>
>>
>> so another
>>
> For short term solution see here:
> http://petereisentraut.blogspot.com/2008/03/readding-implicit-casts-in-postgresql.html
>
>
>
thanks, downloading and testing.....
From: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 20:08:23 |
Message-ID: | 4C0022B7.4060603@sensacd.com.mx |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On 05/28/2010 02:04 PM, erobles wrote:
>
>
> On 05/28/2010 01:51 PM, Adrian Klaver wrote:
>> On 05/28/2010 11:45 AM, erobles wrote:
>>>
>>>
>>> On 05/28/2010 01:26 PM, Adrian Klaver wrote:
>>>> On 05/28/2010 11:20 AM, erobles wrote:
>>>>> hi!
>>>>> only for ask, there is a way to deactivate type validation, so i
>>>>> can do
>>>>>
>>>>> select rtrim(number_field) from table ; with no error and the
>>>>> message:
>>>>> "You might need to explicit type casts"
>>>>>
>>>>> this is postgres 8.3.1.
>>>>>
>>>>
>>>> What are you trying to do? I am trying to think what rtrim does on a
>>>> number.
>>>>
>>>
>>>
>>> you are right, i'm trying to make a rtrim to a number.
>>> the reason of my question is we have a lot of apps with similar
>>> querys ,
>>> when we have postgres7.2 this kind of querys just simply execute very
>>> well, so.. when change to postgres 8.3 this querys fail beacuse they
>>> needit an explicit cast.
>>>
>>> one solution is change the querys of apps and recompile, but time is
>>> short and the deadline is near.
>>>
>>> other solution is create a function to each explicit cast, but we dont
>>> have the time to research if there are more mismatch querys.
>>>
>>> so the easy way is deactivate the validation type ...
>>>
>>>
>>>
>>>
>>>
>>> so another
>>>
>> For short term solution see here:
>> http://petereisentraut.blogspot.com/2008/03/readding-implicit-casts-in-postgresql.html
>>
>>
>>
>
> thanks, downloading and testing.....
>
it did'nt work :-( , because the script is for pg 8.2 and i have pg
7.2 and the table pg_cast doesn't exist. whatever is a good idea but i
need to know the table or tables on postgres 7.2. such as pg_cast
on postgres 8.3, to modify the script.
How can i see the 'private' tables of postgres 7.2, i tried with \d on
template1 , if a made a select on pg_types i have a result, but i don't
know which is the name of the others tables such a
From: | alvherre <alvherre(at)commandprompt(dot)com> |
---|---|
To: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 20:18:10 |
Message-ID: | 1275077808-sup-6949@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Excerpts from erobles's message of vie may 28 16:08:23 -0400 2010:
> it did'nt work :-( , because the script is for pg 8.2 and i have pg
> 7.2 and the table pg_cast doesn't exist. whatever is a good idea but i
> need to know the table or tables on postgres 7.2.
Of course it didn't work if you tried to run it in 7.2; you're supposed
to run it in the 8.3 server, not the old one. The point is to make 8.3
sort-of compatible with the old behavior.
--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
From: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
---|---|
To: | alvherre <alvherre(at)commandprompt(dot)com> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 20:34:24 |
Message-ID: | 4C0028D0.6020403@sensacd.com.mx |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On 05/28/2010 03:18 PM, alvherre wrote:
> Excerpts from erobles's message of vie may 28 16:08:23 -0400 2010:
>
>
>> it did'nt work :-( , because the script is for pg 8.2 and i have pg
>> 7.2 and the table pg_cast doesn't exist. whatever is a good idea but i
>> need to know the table or tables on postgres 7.2.
>>
> Of course it didn't work if you tried to run it in 7.2; you're supposed
> to run it in the 8.3 server, not the old one. The point is to make 8.3
> sort-of compatible with the old behavior.
>
>
did you see the script?
didn't it work because the first command is a psql pointing a pg
server 8.2
the second command is a psql pointing a pg server 8.3
then the command are executed and get the differences
after that made the properly casting fucntions
this result ok , because the postgres 8.x.x have the same database
catalog.... in this case have the table pg_cast
so the query works OK.
the problem in the postgres 7.2 doesn't exists the table pg_cast so i
can't get the information need it to get the differences
so, i need modify the first command run it and get the info in the
same format to get it.
From: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 20:49:30 |
Message-ID: | 4C002C5A.7030500@sensacd.com.mx |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On 05/28/2010 03:34 PM, erobles wrote:
>
>
> On 05/28/2010 03:18 PM, alvherre wrote:
>> Excerpts from erobles's message of vie may 28 16:08:23 -0400 2010:
>>
>>> it did'nt work :-( , because the script is for pg 8.2 and i have pg
>>> 7.2 and the table pg_cast doesn't exist. whatever is a good idea
>>> but i
>>> need to know the table or tables on postgres 7.2.
>> Of course it didn't work if you tried to run it in 7.2; you're supposed
>> to run it in the 8.3 server, not the old one. The point is to make 8.3
>> sort-of compatible with the old behavior.
>>
> did you see the script?
>
> didn't it work because the first command is a psql pointing a pg
> server 8.2
> the second command is a psql pointing a pg server 8.3
> then the command are executed and get the differences
> after that made the properly casting fucntions
>
>
> this result ok , because the postgres 8.x.x have the same database
> catalog.... in this case have the table pg_cast
> so the query works OK.
>
>
>
> the problem in the postgres 7.2 doesn't exists the table pg_cast so
> i can't get the information need it to get the differences
>
> so, i need modify the first command run it and get the info in the
> same format to get it.
>
>
>
>
>
>
>
>
>
i mean:
if postgres 8.3 have a table pg_cast and their fields used on the
script are:
castfunc,
castsource,
casttarget,
castfunc::regprocedure,
castcontext
how can i get the same info from postgres 7.2 , and be able to get
the differences between 8.3 and 7.2
Regards.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 21:18:59 |
Message-ID: | 8269.1275081539@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
erobles <erobles(at)sensacd(dot)com(dot)mx> writes:
> how can i get the same info from postgres 7.2 , and be able to get
> the differences between 8.3 and 7.2
Before the pg_cast catalog there simply wasn't any explicit
representation of available casts. I think what you need to look for is
single-argument functions that have the same name as their result type,
but it was a long time ago.
regards, tom lane
From: | Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> |
---|---|
To: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
Cc: | alvherre <alvherre(at)commandprompt(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 21:37:36 |
Message-ID: | AANLkTin5o2XDMBk91N-g7QTyE37sveF78lDzpwUddETo@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg배트맨 토토SQL |
On Fri, May 28, 2010 at 2:34 PM, erobles <erobles(at)sensacd(dot)com(dot)mx> wrote:
>
>
> On 05/28/2010 03:18 PM, alvherre wrote:
>>
>> Excerpts from erobles's message of vie may 28 16:08:23 -0400 2010:
>>
>>
>>>
>>> it did'nt work :-( , because the script is for pg 8.2 and i have pg
>>> 7.2 and the table pg_cast doesn't exist. whatever is a good idea but i
>>> need to know the table or tables on postgres 7.2.
>>>
>>
>> Of course it didn't work if you tried to run it in 7.2; you're supposed
>> to run it in the 8.3 server, not the old one. The point is to make 8.3
>> sort-of compatible with the old behavior.
>>
>>
>
> did you see the script?
>
> didn't it work because the first command is a psql pointing a pg server
> 8.2
> the second command is a psql pointing a pg server 8.3
> then the command are executed and get the differences
> after that made the properly casting fucntions
Couldn't you just build an 8.2 server for this one time use?
From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-28 21:58:50 |
Message-ID: | 201005281458.51181.adrian.klaver@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On Friday 28 May 2010 1:34:24 pm erobles wrote:
> On 05/28/2010 03:18 PM, alvherre wrote:
> > Excerpts from erobles's message of vie may 28 16:08:23 -0400 2010:
> >> it did'nt work :-( , because the script is for pg 8.2 and i have pg
> >> 7.2 and the table pg_cast doesn't exist. whatever is a good idea but i
> >> need to know the table or tables on postgres 7.2.
> >
> > Of course it didn't work if you tried to run it in 7.2; you're supposed
> > to run it in the 8.3 server, not the old one. The point is to make 8.3
> > sort-of compatible with the old behavior.
>
> did you see the script?
>
> didn't it work because the first command is a psql pointing a pg
> server 8.2
> the second command is a psql pointing a pg server 8.3
> then the command are executed and get the differences
> after that made the properly casting fucntions
>
>
> this result ok , because the postgres 8.x.x have the same database
> catalog.... in this case have the table pg_cast
> so the query works OK.
>
>
>
> the problem in the postgres 7.2 doesn't exists the table pg_cast so i
> can't get the information need it to get the differences
>
> so, i need modify the first command run it and get the info in the
> same format to get it.
I believe you are looking at the wrong file; the shell script. Try instead the
other link http://wiki.postgresql.org/wiki/Image:Pg83-implicit-casts.sql It
contains the functions you need.
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
From: | erobles <erobles(at)sensacd(dot)com(dot)mx> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: there is a way to deactivate type validation on 8.3.1???? |
Date: | 2010-05-29 15:39:09 |
Message-ID: | 4C01351D.9060207@sensacd.com.mx |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On 05/28/2010 04:58 PM, Adrian Klaver wrote:
> On Friday 28 May 2010 1:34:24 pm erobles wrote:
>
>> On 05/28/2010 03:18 PM, alvherre wrote:
>>
>>> Excerpts from erobles's message of vie may 28 16:08:23 -0400 2010:
>>>
>>>> it did'nt work :-( , because the script is for pg 8.2 and i have pg
>>>> 7.2 and the table pg_cast doesn't exist. whatever is a good idea but i
>>>> need to know the table or tables on postgres 7.2.
>>>>
>>> Of course it didn't work if you tried to run it in 7.2; you're supposed
>>> to run it in the 8.3 server, not the old one. The point is to make 8.3
>>> sort-of compatible with the old behavior.
>>>
>> did you see the script?
>>
>> didn't it work because the first command is a psql pointing a pg
>> server 8.2
>> the second command is a psql pointing a pg server 8.3
>> then the command are executed and get the differences
>> after that made the properly casting fucntions
>>
>>
>> this result ok , because the postgres 8.x.x have the same database
>> catalog.... in this case have the table pg_cast
>> so the query works OK.
>>
>>
>>
>> the problem in the postgres 7.2 doesn't exists the table pg_cast so i
>> can't get the information need it to get the differences
>>
>> so, i need modify the first command run it and get the info in the
>> same format to get it.
>>
> I believe you are looking at the wrong file; the shell script. Try instead the
> other link http://wiki.postgresql.org/wiki/Image:Pg83-implicit-casts.sql It
> contains the functions you need.
>
>
thanks!