pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedSQL parse error
9+ messages / 4 participants
[nested] [flat]
* SQL parse error
@ 2000-12-12 09:42 Borek Lupoměský <borekl@volny.cz>
0 siblings, 1 reply; 9+ messages in thread
From: Borek Lupoměský @ 2000-12-12 09:42 UTC (permalink / raw)
To: pgsql-sql
Hello all,
My following problem is:
swports=# select substring(cp from 1 for 4)::int4 from out2cp;
ERROR: pg_atoi: error in "6.1,": can't parse ".1,"
SQL syntax is apparently OK. When I omit the typecast, the query
works:
swports=# select substring(cp from 1 for 4) from out2cp;
substr
--------
3182
3182
3182
-8<- text deleted ---
The cp entries are varchars in form NNNN.N, where N is numeral.
So can someone explain why the parse error?
Bye Borek
--
=====================================================================
BOREK LUPOMESKY Usti nad Labem, Czech Republic, Europe
WWW: http://www.volny.cz/borekl/ PGP keyid: B6A06AEB
==========[ MIME/ISO-8859-2 & PGP encrypted mail welcome ]===========
^ permalink raw reply [nested|flat] 9+ messages in thread
* RE: SQL parse error
@ 2000-12-12 10:21 Francis Solomon <francis@stellison.co.uk>
parent: Borek Lupoměský <borekl@volny.cz>
0 siblings, 1 reply; 9+ messages in thread
From: Francis Solomon @ 2000-12-12 10:21 UTC (permalink / raw)
To: Borek Lupomìský <borekl@volny.cz>; pgsql-sql
Hi Borek,
What version of PostgreSQL are you using? This works fine for me on
7.02. Time to update, maybe?
Hope this helps
Francis
>
> Hello all,
>
> My following problem is:
>
> swports=# select substring(cp from 1 for 4)::int4 from out2cp;
> ERROR: pg_atoi: error in "6.1,": can't parse ".1,"
>
> SQL syntax is apparently OK. When I omit the typecast, the query
> works:
>
> swports=# select substring(cp from 1 for 4) from out2cp;
> substr
> --------
> 3182
> 3182
> 3182
> -8<- text deleted ---
>
> The cp entries are varchars in form NNNN.N, where N is numeral.
> So can someone explain why the parse error?
>
^ permalink raw reply [nested|flat] 9+ messages in thread
* RE: SQL parse error
@ 2000-12-12 10:39 Borek Lupoměský <borekl@volny.cz>
parent: Francis Solomon <francis@stellison.co.uk>
0 siblings, 1 reply; 9+ messages in thread
From: Borek Lupoměský @ 2000-12-12 10:39 UTC (permalink / raw)
To: Francis Solomon <francis@stellison.co.uk>; +Cc: pgsql-sql
On Tue, 12 Dec 2000, Francis Solomon wrote:
FS> What version of PostgreSQL are you using? This works fine for me on
FS> 7.02. Time to update, maybe?
Does not seem to be the case...
ld01ad02:~$ rpm -q postgresql
postgresql-7.0.2-2
Bye Borek
--
=====================================================================
BOREK LUPOMESKY Usti nad Labem, Czech Republic, Europe
WWW: http://www.volny.cz/borekl/ PGP keyid: B6A06AEB
==========[ MIME/ISO-8859-2 & PGP encrypted mail welcome ]===========
^ permalink raw reply [nested|flat] 9+ messages in thread
* RE: SQL parse error
@ 2000-12-12 11:37 Kenn Thompson <kthompson@adestagroup.com>
0 siblings, 0 replies; 9+ messages in thread
From: Kenn Thompson @ 2000-12-12 11:37 UTC (permalink / raw)
To: pgsql-sql; francis@stellison.co.uk; borekl@volny.cz
All-
<soapbox>
While it is not always the case, I see many responses to questions in the form of "Why don't you just upgrade- that's supported in version XXX".
Let me give you several reasons why this is not always possible.
1. Support software is not compatible.
I use Chili!soft for Linux, a webpage/asp solution. Even tho I use the most current version of Chili!Soft, it currently only supports Postgresql 6.5.2. I don't have the option of upgrading. My DB is used by this software, so I would break the dependancy if I upgraded.
2. DB Users may not be DBAs.
If a user is not responsible for the maintenance of the server or the software running on it (such as a third party ISP or IS department), upgrading is not a choice. While suggestions can usually be made, the user is not at liberty to make it happen.
Being that this is an SQL forum for help, it seems appropriate that any reply for assistance should be directed towards the version is use. This is not intended to be a flame against this particular reply, just an observation is general. While stating the version that a particular solution is available is not completely inappropriate, every attempt should be made to offer help in the version that is being presented by the request.
</soapbox>
Sorry if this seems long-winded- it just seems that someone needed to say it...
Kenn
____________________________________________
Kenn Thompson
Senior Web Architect
Adesta Communications
Work: 402.233.7595
Cell: 402.210.6326
>>> "Francis Solomon" <francis@stellison.co.uk> 12/12/00 04:21AM >>>
Hi Borek,
What version of PostgreSQL are you using? This works fine for me on
7.02. Time to update, maybe?
Hope this helps
Francis
>
> Hello all,
>
> My following problem is:
>
> swports=# select substring(cp from 1 for 4)::int4 from out2cp;
> ERROR: pg_atoi: error in "6.1,": can't parse ".1,"
>
> SQL syntax is apparently OK. When I omit the typecast, the query
> works:
>
> swports=# select substring(cp from 1 for 4) from out2cp;
> substr
> --------
> 3182
> 3182
> 3182
> -8<- text deleted ---
>
> The cp entries are varchars in form NNNN.N, where N is numeral.
> So can someone explain why the parse error?
>
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: SQL parse error
@ 2000-12-12 21:17 Tom Lane <tgl@sss.pgh.pa.us>
parent: Borek Lupoměský <borekl@volny.cz>
0 siblings, 2 replies; 9+ messages in thread
From: Tom Lane @ 2000-12-12 21:17 UTC (permalink / raw)
To: Borek Lupoměský <borekl@volny.cz>; +Cc: Francis Solomon <francis@stellison.co.uk>; pgsql-sql
=?ISO-8859-2?Q?Borek_Lupom=ECsk=FD?= <borekl@volny.cz> writes:
> On Tue, 12 Dec 2000, Francis Solomon wrote:
FS> What version of PostgreSQL are you using? This works fine for me on
FS> 7.02. Time to update, maybe?
> Does not seem to be the case...
> ld01ad02:~$ rpm -q postgresql
> postgresql-7.0.2-2
I can't duplicate the problem either. I tried:
play=> create table out2cp(cp varchar(6));
CREATE
play=> insert into out2cp values('3182.1');
INSERT 405833 1
play=> insert into out2cp values('3182.2');
INSERT 405834 1
play=> select substring(cp from 1 for 4)::int4 from out2cp;
?column?
----------
3182
3182
(2 rows)
Does anyone else see a failure with this? If so what platform are you
on, and what build of Postgres are you using?
regards, tom lane
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: SQL parse error
@ 2000-12-12 21:57 Borek Lupoměský <borekl@volny.cz>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 9+ messages in thread
From: Borek Lupoměský @ 2000-12-12 21:57 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql
On Tue, 12 Dec 2000, Tom Lane wrote:
TL> I can't duplicate the problem either. I tried:
TL>
TL> play=> select substring(cp from 1 for 4)::int4 from out2cp;
TL> ?column?
TL> ----------
TL> 3182
TL> 3182
TL> (2 rows)
TL>
TL> Does anyone else see a failure with this? If so what platform are you
TL> on, and what build of Postgres are you using?
Well, I'm running under RedHat Linux 6.x (ia-32) and now I don't
really recall for sure where did I take the RPM, but I think I
downloaded it from ftp.postgresql.org.
OK, tomorrow I'll do some more tests to see where the problem lies
(you know, intranet-homed machine not accessible from public Internet).
Bye Borek
--
=====================================================================
BOREK LUPOMESKY Usti nad Labem, Czech Republic, Europe
WWW: http://www.volny.cz/borekl/ PGP keyid: B6A06AEB
==========[ MIME/ISO-8859-2 & PGP encrypted mail welcome ]===========
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: SQL parse error
@ 2000-12-13 13:59 Borek Lupoměský <borekl@volny.cz>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 9+ messages in thread
From: Borek Lupoměský @ 2000-12-13 13:59 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Francis Solomon <francis@stellison.co.uk>; pgsql-sql
On Tue, 12 Dec 2000, Tom Lane wrote:
TL> play=> create table out2cp(cp varchar(6));
TL> CREATE
TL> play=> insert into out2cp values('3182.1');
TL> INSERT 405833 1
TL> play=> insert into out2cp values('3182.2');
TL> INSERT 405834 1
TL> play=> select substring(cp from 1 for 4)::int4 from out2cp;
TL> ?column?
TL> ----------
TL> 3182
TL> 3182
TL> (2 rows)
When I do this, it works for me, too. But when I do it on my current
database, something breaks. The table I work on is:
swports=# \d out2cp
Table "out2cp"
Attribute | Type | Modifier
-----------+-------------+----------
cp | varchar(10) |
outlet | varchar(10) |
location | varchar(32) |
Index: o2c_cp
Values in cp field look like this:
swports=# select cp from out2cp ;
cp
---------
3182.4
3182.7
3182.2
3182.5
3182.6
3182.8
3169.1
3169.3
3169.4
3169.7
3165.1
Bye Borek
--
=====================================================================
BOREK LUPOMESKY Usti nad Labem, Czech Republic, Europe
WWW: http://www.volny.cz/borekl/ PGP keyid: B6A06AEB
==========[ MIME/ISO-8859-2 & PGP encrypted mail welcome ]===========
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: SQL parse error
@ 2000-12-13 16:58 Tom Lane <tgl@sss.pgh.pa.us>
parent: Borek Lupoměský <borekl@volny.cz>
0 siblings, 1 reply; 9+ messages in thread
From: Tom Lane @ 2000-12-13 16:58 UTC (permalink / raw)
To: Borek Lupoměský <borekl@volny.cz>; +Cc: Francis Solomon <francis@stellison.co.uk>; pgsql-sql
=?ISO-8859-2?Q?Borek_Lupom=ECsk=FD?= <borekl@volny.cz> writes:
> When I do this, it works for me, too. But when I do it on my current
> database, something breaks.
Hm. The obvious question is: are you *sure* all the entries in your
table look like "NNNN.N"?
regards, tom lane
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: SQL parse error
@ 2000-12-13 17:22 Borek Lupoměský <borekl@volny.cz>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 9+ messages in thread
From: Borek Lupoměský @ 2000-12-13 17:22 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Francis Solomon <francis@stellison.co.uk>; pgsql-sql
On Wed, 13 Dec 2000, Tom Lane wrote:
TL> =?ISO-8859-2?Q?Borek_Lupom=ECsk=FD?= <borekl@volny.cz> writes:
TL> > When I do this, it works for me, too. But when I do it on my current
TL> > database, something breaks.
TL>
TL> Hm. The obvious question is: are you *sure* all the entries in your
TL> table look like "NNNN.N"?
You're right -- not all of them do, there are some anomalous
ones.
Thanks for your help and pardon my ignorance.
Bye Borek
--
=====================================================================
BOREK LUPOMESKY Usti nad Labem, Czech Republic, Europe
WWW: http://www.volny.cz/borekl/ PGP keyid: B6A06AEB
==========[ MIME/ISO-8859-2 & PGP encrypted mail welcome ]===========
^ permalink raw reply [nested|flat] 9+ messages in thread
end of thread, other threads:[~2000-12-13 17:22 UTC | newest]
Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-12 09:42 SQL parse error Borek Lupoměský <borekl@volny.cz>
2000-12-12 10:21 ` Francis Solomon <francis@stellison.co.uk>
2000-12-12 10:39 ` Borek Lupoměský <borekl@volny.cz>
2000-12-12 21:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-12-12 21:57 ` Borek Lupoměský <borekl@volny.cz>
2000-12-13 13:59 ` Borek Lupoměský <borekl@volny.cz>
2000-12-13 16:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-12-13 17:22 ` Borek Lupoměský <borekl@volny.cz>
2000-12-12 11:37 RE: SQL parse error Kenn Thompson <kthompson@adestagroup.com>
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