pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
invalid input syntax for type tid: "(,)"
10+ messages / 5 participants
[nested] [flat]

* invalid input syntax for type tid: "(,)"
@ 2004-04-03 17:57 Jose' Cruanyes <cruanyes@cegroup.it>
  0 siblings, 0 replies; 10+ messages in thread

From: Jose' Cruanyes @ 2004-04-03 17:57 UTC (permalink / raw)
  To: pgsql-admin@postgresql.org; pgsql-odbc; pgsql-ports@postgresql.org

at a point the postgresql ODBC driver issues a command like this (not 
questioning here how useful or correct it could be)		

select * from table1 where ctid = '(,)';

this command works (?) returning zero rows without error, even from 
psql,
when the db is hosted in the following systems:

- debian i386 using the stable postgresql7.2.1-2 package
- debian ppc using the stable postgresql7.2.1-2 package
- debian i386 using the testing postgresql7.4.2-2 package
- MacOSX 10.2 using the 7.3.4 compiled from source


but when hosted in a MacOSX 10.3 (Panther) using postgres 7.4.x 
compiled from source we get:

		ERROR:  invalid input syntax for type tid: "(,)"

I've tried on three different machines and a miriad of different 
configure parameters and always get the same error...

could be an incompatible version of some external lib?
who is responsible of the parsing of the command?

as hint:
when installing 7.4.2 on Panther we got a warning telling us about the 
version of bison, we have upgraded it anyway to 1.875,



Pax et Bonum

# dott. Jose' Cruanyes Aguilar  -  C.E. Soft srl
#  Pzza. Firenze,4 MILANO  -  XX Settembre 10, CREMONA
#   02,33603122                0372,460602




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* invalid input syntax for type tid: "(,)"
@ 2004-04-03 21:51 Jose' Cruanyes <cruanyes@cegroup.it>
  2004-04-04 05:04 ` Re: [ODBC] invalid input syntax for type tid: "(,)" Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 10+ messages in thread

From: Jose' Cruanyes @ 2004-04-03 21:51 UTC (permalink / raw)
  To: pgsql-admin@postgresql.org; pgsql-odbc; pgsql-ports@postgresql.org

at a point the postgresql ODBC driver issues a command like this (not
questioning here how useful or correct it could be)		

select * from table1 where ctid = '(,)';

this command works (?) returning zero rows without error, even from
psql,
when the db is hosted in the following systems:

- debian i386 using the stable postgresql7.2.1-2 package
- debian ppc using the stable postgresql7.2.1-2 package
- debian i386 using the testing postgresql7.4.2-2 package
- MacOSX 10.2 using the 7.3.4 compiled from source


but when hosted in a MacOSX 10.3 (Panther) using postgres 7.4.x, or 
7.3.x
compiled from source we get:

(in 7.4)		ERROR:  invalid input syntax for type tid: "(,)"
or
(in 7.3)		ERROR: tidin: invalid value

I've tried on three different machines and a miriad of different
configure parameters and always get the same error...

probably is an incompatible version of some external lib?, which one?
who is responsible of the parsing of the command?





Pax et Bonum

# dott. Jose' Cruanyes Aguilar  -  C.E. Soft srl
#  Pzza. Firenze,4 MILANO  -  XX Settembre 10, CREMONA
#   02,33603122                0372,460602




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [ODBC] invalid input syntax for type tid: "(,)"
  2004-04-03 21:51 invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
@ 2004-04-04 05:04 ` Tom Lane <tgl@sss.pgh.pa.us>
  2004-04-04 21:51   ` Re: invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
  0 siblings, 1 reply; 10+ messages in thread

From: Tom Lane @ 2004-04-04 05:04 UTC (permalink / raw)
  To: Jose' Cruanyes <cruanyes@cegroup.it>; +Cc: pgsql-admin@postgresql.org; pgsql-odbc; pgsql-ports@postgresql.org

"Jose' Cruanyes" <cruanyes@cegroup.it> writes:
> select * from table1 where ctid = '(,)';
> [ works on some machines and not others ]

I would argue that the ODBC driver is broken and needs to be fixed,
as does the TID input parser which should never allow this ...

However, the reason for the platform dependency is probably that
strtoul() is setting errno on some machines and not others.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: invalid input syntax for type tid: "(,)"
  2004-04-03 21:51 invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
  2004-04-04 05:04 ` Re: [ODBC] invalid input syntax for type tid: "(,)" Tom Lane <tgl@sss.pgh.pa.us>
@ 2004-04-04 21:51   ` Jose' Cruanyes <cruanyes@cegroup.it>
  2004-04-05 09:32     ` Re: invalid input syntax for type tid: '(,)' Dave Page <dpage@vale-housing.co.uk>
  2004-04-06 14:32     ` Re: invalid input syntax for type tid: "(,)" Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 2 replies; 10+ messages in thread

From: Jose' Cruanyes @ 2004-04-04 21:51 UTC (permalink / raw)
  To: pgsql-odbc


On Apr 4, 2004, at 7:04 AM, Tom Lane wrote:

> "Jose' Cruanyes" <cruanyes@cegroup.it> writes:
>> select * from table1 where ctid = '(,)';
>> [ works on some machines and not others ]
>
> I would argue that the ODBC driver is broken and needs to be fixed,
> as does the TID input parser which should never allow this ...
>
> However, the reason for the platform dependency is probably that
> strtoul() is setting errno on some machines and not othe

since strtoul() should return 0 on an empty string, I think it will be 
safe to change the instances of '(,)' to '(0,0)' in the driver source 
code, even if it's not too clear to me what it does...

I've found three, two on "convert.c" and one on "results.c"

now if some one can put the changes upstream...

thanks.

Pax et Bonum

# dott. Jose' Cruanyes Aguilar  -  C.E. Soft srl
#  Pzza. Firenze,4 MILANO  -  XX Settembre 10, CREMONA
#   02,33603122                0372,460602




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: invalid input syntax for type tid: '(,)'
  2004-04-03 21:51 invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
  2004-04-04 05:04 ` Re: [ODBC] invalid input syntax for type tid: "(,)" Tom Lane <tgl@sss.pgh.pa.us>
  2004-04-04 21:51   ` Re: invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
@ 2004-04-05 09:32     ` Dave Page <dpage@vale-housing.co.uk>
  2004-04-05 11:21       ` Re: invalid input syntax for type tid: '(,)' Jose' Cruanyes <cruanyes@cegroup.it>
  1 sibling, 1 reply; 10+ messages in thread

From: Dave Page @ 2004-04-05 09:32 UTC (permalink / raw)
  To: cruanyes@cegroup.it; +Cc: pgsql-odbc

It's rumoured that Jose Cruanyes once said:
>
> I've found three, two on "convert.c" and one on "results.c"
>
> now if some one can put the changes upstream...
>

Can you post a patch?

Regards, Dave





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: invalid input syntax for type tid: '(,)'
  2004-04-03 21:51 invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
  2004-04-04 05:04 ` Re: [ODBC] invalid input syntax for type tid: "(,)" Tom Lane <tgl@sss.pgh.pa.us>
  2004-04-04 21:51   ` Re: invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
  2004-04-05 09:32     ` Re: invalid input syntax for type tid: '(,)' Dave Page <dpage@vale-housing.co.uk>
@ 2004-04-05 11:21       ` Jose' Cruanyes <cruanyes@cegroup.it>
  0 siblings, 0 replies; 10+ messages in thread

From: Jose' Cruanyes @ 2004-04-05 11:21 UTC (permalink / raw)
  To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc


On Apr 5, 2004, at 11:32 AM, Dave Page wrote:

> It's rumoured that Jose Cruanyes once said:
>>
>> I've found three, two on "convert.c" and one on "results.c"
>>
>> now if some one can put the changes upstream...
>>
>
> Can you post a patch?
>
--------------<cut>--------------8<----------------8<------------- 
-8<------------------
inline patch 1: psqlodbc-new/convert.c Sun Apr 4 19:39:39 2004 (+0/-1 lines) download inline-1.patchdiff -Naur psqlodbc-old/convert.c psqlodbc-new/convert.c --- psqlodbc-old/convert.c Mon Oct 20 02:37:42 2003 +++ psqlodbc-new/convert.c Sun Apr 4 19:39:39 2004 @@ -2059,7 +2059,7 @@ * 1st query is for field information * 2nd query is keyset gathering */ - CVT_APPEND_STR(qb, " where ctid =
'(,)';select ctid, oid from "); + CVT_APPEND_STR(qb, " where ctid = '(0,0)';select ctid, oid from "); CVT_APPEND_DATA(qb, qp->statement + qp->from_pos + 5, npos - qp->from_pos - 5); } } @@ -2102,7 +2102,7 @@ qb->load_stmt_len = qb->npos; if (0 != (qb->flags & FLGB_KEYSET_DRIVEN)) { - CVT_APPEND_STR(qb, "where ctid = '(,)';select CTID, OID from "); + CVT_APPEND_STR(qb, "where ctid = '(0,0)';select CTID, OID from "); CVT_APPEND_DATA(qb, qp->statement + qp->from_pos + 5, qp->where_pos - qp->from_pos - 5); } }
inline patch 2: psqlodbc-new/results.c Sun Apr 4 20:33:47 2004 (+0/-1 lines) download inline-2.patchdiff -Naur psqlodbc-old/results.c psqlodbc-new/results.c --- psqlodbc-old/results.c Mon Oct 20 02:37:42 2003 +++ psqlodbc-new/results.c Sun Apr 4 20:33:47 2004 @@ -1827,7 +1827,7 @@ { len += 50; selstr = malloc(len); - sprintf(selstr, "%s where ctid = currtid(0, '(,)') and
oid = %u", stmt->load_statement, oid); + sprintf(selstr, "%s where ctid = currtid(0, '(0,0)') and oid = %u", stmt->load_statement, oid); } else { --------------<cut>--------------8<----------------8<------------- -8<------------------ Pax et Bonum # dott. Jose' Cruanyes Aguilar - C.E. Soft srl # Pzza. Firenze,4 MILANO - XX Settembre 10, CREMONA # 02,33603122 0372,460602 Patches: download all (2 files, .tar.gz) ^ permalink raw reply [nested|flat] 10+ messages in thread

* Re: invalid input syntax for type tid: "(,)"
  2004-04-03 21:51 invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
  2004-04-04 05:04 ` Re: [ODBC] invalid input syntax for type tid: "(,)" Tom Lane <tgl@sss.pgh.pa.us>
  2004-04-04 21:51   ` Re: invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
@ 2004-04-06 14:32     ` Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 0 replies; 10+ messages in thread

From: Bruce Momjian @ 2004-04-06 14:32 UTC (permalink / raw)
  To: Jose' Cruanyes <cruanyes@cegroup.it>; +Cc: pgsql-odbc

Jose' Cruanyes wrote:
> 
> On Apr 4, 2004, at 7:04 AM, Tom Lane wrote:
> 
> > "Jose' Cruanyes" <cruanyes@cegroup.it> writes:
> >> select * from table1 where ctid = '(,)';
> >> [ works on some machines and not others ]
> >
> > I would argue that the ODBC driver is broken and needs to be fixed,
> > as does the TID input parser which should never allow this ...
> >
> > However, the reason for the platform dependency is probably that
> > strtoul() is setting errno on some machines and not othe
> 
> since strtoul() should return 0 on an empty string, I think it will be 
> safe to change the instances of '(,)' to '(0,0)' in the driver source 
> code, even if it's not too clear to me what it does...
> 
> I've found three, two on "convert.c" and one on "results.c"
> 
> now if some one can put the changes upstream...

Has this been fixed in ODBC CVS?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: invalid input syntax for type tid: '(,)'
@ 2004-04-05 13:08 Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 10+ messages in thread

From: Dave Page @ 2004-04-05 13:08 UTC (permalink / raw)
  To: Jose' Cruanyes <cruanyes@cegroup.it>; +Cc: pgsql-odbc

Thanks Jose, patch applied.

Regards, Dave. 

> -----Original Message-----
> From: Jose' Cruanyes [mailto:cruanyes@cegroup.it] 
> Sent: 05 April 2004 12:21
> To: Dave Page
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] invalid input syntax for type tid: '(,)'
> 
> 
> On Apr 5, 2004, at 11:32 AM, Dave Page wrote:
> 
> > It's rumoured that Jose Cruanyes once said:
> >>
> >> I've found three, two on "convert.c" and one on "results.c"
> >>
> >> now if some one can put the changes upstream...
> >>
> >
> > Can you post a patch?
> >
> --------------<cut>--------------8<----------------8<-------------
> -8<------------------
> diff -Naur psqlodbc-old/convert.c psqlodbc-new/convert.c
> --- psqlodbc-old/convert.c      Mon Oct 20 02:37:42 2003
> +++ psqlodbc-new/convert.c      Sun Apr  4 19:39:39 2004
> @@ -2059,7 +2059,7 @@
>                                   * 1st query is for field information
>                                   * 2nd query is keyset gathering
>                                   */
> -                               CVT_APPEND_STR(qb, " where ctid =  
> '(,)';select ctid, oid from ");
> +                               CVT_APPEND_STR(qb, " where ctid =
> '(0,0)';select ctid, oid from ");
>                                  CVT_APPEND_DATA(qb, qp->statement +  
> qp->from_pos + 5, npos - qp->from_pos - 5);
>                          }
>                  }
> @@ -2102,7 +2102,7 @@
>                  qb->load_stmt_len = qb->npos;
>                  if (0 != (qb->flags & FLGB_KEYSET_DRIVEN))
>                  {
> -                       CVT_APPEND_STR(qb, "where ctid = 
> '(,)';select  
> CTID, OID from ");
> +                       CVT_APPEND_STR(qb, "where ctid = 
> '(0,0)';select
> CTID, OID from ");
>                          CVT_APPEND_DATA(qb, qp->statement +  
> qp->from_pos + 5, qp->where_pos - qp->from_pos - 5);
>                  }
>          }
> diff -Naur psqlodbc-old/results.c psqlodbc-new/results.c
> --- psqlodbc-old/results.c      Mon Oct 20 02:37:42 2003
> +++ psqlodbc-new/results.c      Sun Apr  4 20:33:47 2004
> @@ -1827,7 +1827,7 @@
>          {
>                  len += 50;
>                  selstr = malloc(len);
> -               sprintf(selstr, "%s where ctid = currtid(0, 
> '(,)') and  
> oid = %u", stmt->load_statement, oid);
> +               sprintf(selstr, "%s where ctid = currtid(0, '(0,0)')
> and oid = %u", stmt->load_statement, oid);
>          }
>          else
>          {
> --------------<cut>--------------8<----------------8<-------------
> -8<------------------
> 
> 
> 
> 
> 
> Pax et Bonum
> 
> # dott. Jose' Cruanyes Aguilar  -  C.E. Soft srl
> #  Pzza. Firenze,4 MILANO  -  XX Settembre 10, CREMONA
> #   02,33603122                0372,460602
> 
> 



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: invalid input syntax for type tid: "(,)"
@ 2004-04-05 19:07 Craig Hockenberry <craig@iconfactory.com>
  0 siblings, 0 replies; 10+ messages in thread

From: Craig Hockenberry @ 2004-04-05 19:07 UTC (permalink / raw)
  To: pgsql-odbc

Jose' & Tom,

I had a similar problem running on Mac OS X Server (Panther). For example:

DROP TABLE test1;
CREATE TABLE test1 (
    id1 INTEGER PRIMARY KEY,
    id2 INT NOT NULL,
    data VARCHAR(255) NOT NULL
);

DROP TABLE test2;
CREATE TABLE test2 (
    id2 INTEGER PRIMARY KEY,
    data VARCHAR(255) NOT NULL
);

INSERT INTO test1 (id1, id2, data) VALUES (1, 1, 'A');
INSERT INTO test1 (id1, id2, data) VALUES (2, 1, 'B');
INSERT INTO test1 (id1, id2, data) VALUES (3, 1, 'C');
INSERT INTO test1 (id1, id2, data) VALUES (4, 2, 'D');
INSERT INTO test1 (id1, id2, data) VALUES (5, 2, 'E');
INSERT INTO test1 (id1, id2, data) VALUES (6, 2, 'F');
INSERT INTO test1 (id1, id2, data) VALUES (7, 2, 'G');
INSERT INTO test1 (id1, id2, data) VALUES (8, 3, 'H');

INSERT INTO test2 (id2, data) VALUES (1, 'z');
INSERT INTO test2 (id2, data) VALUES (2, 'y');
INSERT INTO test2 (id2, data) VALUES (3, 'x');


SELECT data FROM test1 WHERE id2 = 2;

    [fails with ctid error]

SELECT test1.data FROM test1, test2 WHERE (test1.id2 = test2.id2) AND
(test1.id2 = 2)

    [works as expected]

It does appear to be a problem with the ODBC 7.03.02.00 driver -- queries
passing through JDBC or psql do not exhibit the behavior. Queries were being
made against PostgreSQL 7.4.

The workaround in my case was to turn off "Updatable Cursors" in the DSN
datasource options (page 2). By default, it is enabled.

A message from Hiroshi Inoue in the archives indicates that updatable
cursors are not supported by the drive -- maybe a short term solution is to
make the default setting be disabled (or be removed completely.)

-ch


> at a point the postgresql ODBC driver issues a command like this (not
> questioning here how useful or correct it could be)
> 
> select * from table1 where ctid = '(,)';
> 
> this command works (?) returning zero rows without error, even from
> psql,
> when the db is hosted in the following systems:
> 
> - debian i386 using the stable postgresql7.2.1-2 package
> - debian ppc using the stable postgresql7.2.1-2 package
> - debian i386 using the testing postgresql7.4.2-2 package
> - MacOSX 10.2 using the 7.3.4 compiled from source
> 
> 
> but when hosted in a MacOSX 10.3 (Panther) using postgres 7.4.x, or
> 7.3.x
> compiled from source we get:
> 
> (in 7.4)        ERROR:  invalid input syntax for type tid: "(,)"
> or
> (in 7.3)        ERROR: tidin: invalid value
> 
> I've tried on three different machines and a miriad of different
> configure parameters and always get the same error...
> 
> probably is an incompatible version of some external lib?, which one?
> who is responsible of the parsing of the command?

>> select * from table1 where ctid = '(,)';
>> [ works on some machines and not others ]
> 
> I would argue that the ODBC driver is broken and needs to be fixed,
> as does the TID input parser which should never allow this ...
> 
> However, the reason for the platform dependency is probably that
> strtoul() is setting errno on some machines and not others.
> 
> regards, tom lane




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: invalid input syntax for type tid: "(,)"
@ 2004-04-06 15:06 Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 10+ messages in thread

From: Dave Page @ 2004-04-06 15:06 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; Jose' Cruanyes <cruanyes@cegroup.it>; +Cc: pgsql-odbc

 

> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us] 
> Sent: 06 April 2004 15:33
> To: Jose' Cruanyes
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] invalid input syntax for type tid: "(,)"
> 
> Jose' Cruanyes wrote:
> > 
> > since strtoul() should return 0 on an empty string, I think 
> it will be 
> > safe to change the instances of '(,)' to '(0,0)' in the 
> driver source 
> > code, even if it's not too clear to me what it does...
> > 
> > I've found three, two on "convert.c" and one on "results.c"
> > 
> > now if some one can put the changes upstream...
> 
> Has this been fixed in ODBC CVS?

Yes.

Regards, Dave.



^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2004-04-06 15:06 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-03 17:57 invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
2004-04-03 21:51 invalid input syntax for type tid: "(,)" Jose' Cruanyes <cruanyes@cegroup.it>
2004-04-04 05:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-04-04 21:51   ` Jose' Cruanyes <cruanyes@cegroup.it>
2004-04-05 09:32     ` Re: invalid input syntax for type tid: '(,)' Dave Page <dpage@vale-housing.co.uk>
2004-04-05 11:21       ` Re: invalid input syntax for type tid: '(,)' Jose' Cruanyes <cruanyes@cegroup.it>
2004-04-06 14:32     ` Bruce Momjian <pgman@candle.pha.pa.us>
2004-04-05 13:08 Re: invalid input syntax for type tid: '(,)' Dave Page <dpage@vale-housing.co.uk>
2004-04-05 19:07 Re: invalid input syntax for type tid: "(,)" Craig Hockenberry <craig@iconfactory.com>
2004-04-06 15:06 Re: invalid input syntax for type tid: "(,)" Dave Page <dpage@vale-housing.co.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox