Re: [GENERAL] MySQL -> PostgreSQL conversion issue

2011-08-20 Thread DM
Thank you for your reply, sorry for the late response, your reply really helped me. Thanks Deepak On Fri, Aug 19, 2011 at 11:39 AM, Alban Hertroys < dal...@solfertje.student.utwente.nl> wrote: > On 19 Aug 2011, at 14:50, DM wrote: > > > Hi All, > > > > how to insert mysql (datetime interval) dat

Re: [GENERAL] MySQL -> PostgreSQL conversion issue

2011-08-19 Thread Alban Hertroys
On 19 Aug 2011, at 14:50, DM wrote: > Hi All, > > how to insert mysql (datetime interval) data to postgrres interval datatype. > > mysql > | test_interval | datetime | YES | | 1970-01-02 00:00:00 | > | > > psql > test_interval | interval | > > > an

Re: [GENERAL] MySQL -> PostgreSQL conversion issue

2011-08-19 Thread Andy Colson
On 8/19/2011 7:50 AM, DM wrote: Hi All, how to insert mysql (datetime interval) data to postgrres interval datatype. mysql | test_interval | datetime | YES | | 1970-01-02 00:00:00 | | psql test_interval | interval | any solution for this? thank

[GENERAL] MySQL -> PostgreSQL conversion issue

2011-08-19 Thread DM
Hi All, how to insert mysql (datetime interval) data to postgrres interval datatype. mysql | test_interval | datetime | YES | | 1970-01-02 00:00:00 | | psql test_interval | interval | any solution for this? thanks Deepak

Re: [GENERAL] MySQL -> PostgreSQL conversion issue

2010-10-28 Thread Alex Hunsaker
On Thu, Oct 28, 2010 at 20:02, Scott Newton wrote: > On Fri, 29 Oct 2010 14:40:51 Tom Lane wrote: >> Anyway, you've got two different typing violations there, so you need >> two casts to fix it: > Unfortunately not: > from cc_call cdr left join cc_card cc on cdr.card_id=cc.id left join >        

Re: [GENERAL] MySQL -> PostgreSQL conversion issue

2010-10-28 Thread Scott Newton
On Fri, 29 Oct 2010 14:40:51 Tom Lane wrote: > [ blanch... ] That's not the worst SQL code I've ever seen, but it > might be in the top ten. They're apparently trying to see whether > tf.dnid, taken as a string, matches a prefix of cdr.dnid --- but what if > you have say 123 versus "1234foo"? Th

Re: [GENERAL] MySQL -> PostgreSQL conversion issue

2010-10-28 Thread Tom Lane
Scott Newton writes: > I have the following rather complicated SQL which works under MySQL but fails > under PostgreSQL 8.3. The SQL is generated by A2Billing > (http://www.asterisk2billing.org/cgi-bin/trac.cgi). The issue is the > following > part of the SQL: > as tf on tf.dnid=substr(cdr.dn

Re: [GENERAL] MySQL -> PostgreSQL conversion issue

2010-10-28 Thread Dann Corbit
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Scott Marlowe > Sent: Thursday, October 28, 2010 6:31 PM > To: Scott Newton > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] MySQL -&g

Re: [GENERAL] MySQL -> PostgreSQL conversion issue

2010-10-28 Thread Scott Marlowe
On Thu, Oct 28, 2010 at 6:44 PM, Scott Newton wrote: > Hi > > I have the following rather complicated SQL which works under MySQL but fails > under PostgreSQL 8.3. The SQL is generated by A2Billing > (http://www.asterisk2billing.org/cgi-bin/trac.cgi). The issue is the following > part of the SQL:

[GENERAL] MySQL -> PostgreSQL conversion issue

2010-10-28 Thread Scott Newton
Hi I have the following rather complicated SQL which works under MySQL but fails under PostgreSQL 8.3. The SQL is generated by A2Billing (http://www.asterisk2billing.org/cgi-bin/trac.cgi). The issue is the following part of the SQL: as tf on tf.dnid=substr(cdr.dnid,1,length(tf.dnid)) where tf