pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedAnother user error?
10+ messages / 4 participants
[nested] [flat]
* Another user error?
@ 2020-11-01 18:53 Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 18:57 ` Re: Another user error? Adrian Klaver <adrian.klaver@aklaver.com>
2020-11-01 18:59 ` Re: Another user error? Francisco Olarte <folarte@peoplecall.com>
2020-11-01 19:00 ` Re: Another user error? Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 19:13 ` Re: Another user error? David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 4 replies; 10+ messages in thread
From: Rich Shepard @ 2020-11-01 18:53 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
When trying to populate the locations table I get this error:
psql:locations.sql:2105: ERROR: syntax error at or near ";"
LINE 2105: ...E Airport Way',null,'Portland','OR','97218',null,null,null);
^
Line 2105 is the last line in the file and is terminated with the only
semi-colon in the file. Every line prior to this one is terminated with a
colon. All other syntax errors have been corrected.
I've not encountered this issue before. Where should I look for the error?
TIA,
Rich
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Another user error?
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
@ 2020-11-01 18:57 ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-11-01 18:59 ` Re: Another user error? Rich Shepard <rshepard@appl-ecosys.com>
3 siblings, 1 reply; 10+ messages in thread
From: Adrian Klaver @ 2020-11-01 18:57 UTC (permalink / raw)
To: Rich Shepard <rshepard@appl-ecosys.com>; pgsql-general@lists.postgresql.org
On 11/1/20 10:53 AM, Rich Shepard wrote:
> When trying to populate the locations table I get this error:
> psql:locations.sql:2105: ERROR: syntax error at or near ";"
> LINE 2105: ...E Airport Way',null,'Portland','OR','97218',null,null,null);
> ^
> Line 2105 is the last line in the file and is terminated with the only
> semi-colon in the file. Every line prior to this one is terminated with a
> colon. All other syntax errors have been corrected.
I'm hoping that it is:
'Every line prior to this one is terminated with a comma'
not colon.
>
> I've not encountered this issue before. Where should I look for the error?
>
> TIA,
>
> Rich
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Another user error?
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 18:57 ` Re: Another user error? Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-11-01 18:59 ` Rich Shepard <rshepard@appl-ecosys.com>
0 siblings, 0 replies; 10+ messages in thread
From: Rich Shepard @ 2020-11-01 18:59 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On Sun, 1 Nov 2020, Adrian Klaver wrote:
> I'm hoping that it is:
> 'Every line prior to this one is terminated with a comma'
> not colon.
Adrian,
That's the case. The only colons are within strings.
Thanks,
Rich
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Another user error?
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
@ 2020-11-01 18:59 ` Francisco Olarte <folarte@peoplecall.com>
2020-11-01 19:04 ` Re: Another user error? Rich Shepard <rshepard@appl-ecosys.com>
3 siblings, 1 reply; 10+ messages in thread
From: Francisco Olarte @ 2020-11-01 18:59 UTC (permalink / raw)
To: Rich Shepard <rshepard@appl-ecosys.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
On Sun, Nov 1, 2020 at 7:54 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:
>
> When trying to populate the locations table I get this error:
> psql:locations.sql:2105: ERROR: syntax error at or near ";"
> LINE 2105: ...E Airport Way',null,'Portland','OR','97218',null,null,null);
> ^
> Line 2105 is the last line in the file and is terminated with the only
> semi-colon in the file. Every line prior to this one is terminated with a
> colon. All other syntax errors have been corrected.
>
> I've not encountered this issue before. Where should I look for the error?
This is nearly impossible to diagnose without a chunk of the query (
i,e, the first lines and the last ones ).
It smells to missing parentheses. If you use some editor witch matches
them, try adding one BEFORE the semicolon. If it matches something
above you've got it.
But really, show your code, otherwise you are not going to get much help.
Francisco Olarte.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Another user error?
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 18:59 ` Re: Another user error? Francisco Olarte <folarte@peoplecall.com>
@ 2020-11-01 19:04 ` Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 19:10 ` Re: Another user error? Adrian Klaver <adrian.klaver@aklaver.com>
2020-11-01 19:46 ` Re: Another user error? Francisco Olarte <folarte@peoplecall.com>
0 siblings, 2 replies; 10+ messages in thread
From: Rich Shepard @ 2020-11-01 19:04 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On Sun, 1 Nov 2020, Francisco Olarte wrote:
> This is nearly impossible to diagnose without a chunk of the query (
> i,e, the first lines and the last ones ).
Francisco,
$ psql -d bustrac -f locations.sql
> It smells to missing parentheses. If you use some editor witch matches
> them, try adding one BEFORE the semicolon. If it matches something
> above you've got it.
Here're the last two lines:
(2297,1,'Principal place of business','600 SE Bay Boulevard',null,'Newport','OR','97365','541-265-7758','541-265-4235',null),
(2298,1,'Principal place of business','7200 NE Airport Way',null,'Portland','OR','97218',null,null,null);
And psql found a few missing terminating parentheses and commas which were
fixed. I expected this last run to successfully complete.
Regards,
Rich
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Another user error?
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 18:59 ` Re: Another user error? Francisco Olarte <folarte@peoplecall.com>
2020-11-01 19:04 ` Re: Another user error? Rich Shepard <rshepard@appl-ecosys.com>
@ 2020-11-01 19:10 ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-11-01 19:43 ` Re: Another user error? Rich Shepard <rshepard@appl-ecosys.com>
1 sibling, 1 reply; 10+ messages in thread
From: Adrian Klaver @ 2020-11-01 19:10 UTC (permalink / raw)
To: Rich Shepard <rshepard@appl-ecosys.com>; pgsql-general@lists.postgresql.org
On 11/1/20 11:04 AM, Rich Shepard wrote:
> On Sun, 1 Nov 2020, Francisco Olarte wrote:
>
>> This is nearly impossible to diagnose without a chunk of the query (
>> i,e, the first lines and the last ones ).
>
> Francisco,
>
> $ psql -d bustrac -f locations.sql
>
>> It smells to missing parentheses. If you use some editor witch matches
>> them, try adding one BEFORE the semicolon. If it matches something
>> above you've got it.
>
> Here're the last two lines:
> (2297,1,'Principal place of business','600 SE Bay
> Boulevard',null,'Newport','OR','97365','541-265-7758','541-265-4235',null),
> (2298,1,'Principal place of business','7200 NE Airport
> Way',null,'Portland','OR','97218',null,null,null);
Also need the beginning lines including the INSERT part.
>
> And psql found a few missing terminating parentheses and commas which were
> fixed. I expected this last run to successfully complete.
>
> Regards,
>
> Rich
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Another user error?
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 18:59 ` Re: Another user error? Francisco Olarte <folarte@peoplecall.com>
2020-11-01 19:04 ` Re: Another user error? Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 19:10 ` Re: Another user error? Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-11-01 19:43 ` Rich Shepard <rshepard@appl-ecosys.com>
0 siblings, 0 replies; 10+ messages in thread
From: Rich Shepard @ 2020-11-01 19:43 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On Sun, 1 Nov 2020, Adrian Klaver wrote:
> Also need the beginning lines including the INSERT part.
insert into locations (org_nbr,loc_nbr,loc_name,loc_addr1,loc_addr2,loc_city,state_code,loc_postcode,loc_phone,loc_fax,comment) values
(1,1,'2nd Bridge Gravel Bar','16156 Hwy 101 S',null,'Brookings','OR','97415-0224','541-469-5341',null,null),
Again, while in previous runs psql had found errors none other than the final semicolon
showed up in this last one.
Rich
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Another user error?
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 18:59 ` Re: Another user error? Francisco Olarte <folarte@peoplecall.com>
2020-11-01 19:04 ` Re: Another user error? Rich Shepard <rshepard@appl-ecosys.com>
@ 2020-11-01 19:46 ` Francisco Olarte <folarte@peoplecall.com>
1 sibling, 0 replies; 10+ messages in thread
From: Francisco Olarte @ 2020-11-01 19:46 UTC (permalink / raw)
To: Rich Shepard <rshepard@appl-ecosys.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Rich:
On Sun, Nov 1, 2020 at 8:04 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:
>
> On Sun, 1 Nov 2020, Francisco Olarte wrote:
>
> > This is nearly impossible to diagnose without a chunk of the query (
> > i,e, the first lines and the last ones ).
> Francisco,
> $ psql -d bustrac -f locations.sql
This is NOT the first line of the query. Even "head locations.sql" is
not guaranteed to give the first line of the query ( you know it, we
do not, it may have a few selects ata the top.
What I mean is something like ....
>>>>>>>>
insert into locations balh, blerg, blub values
(1,2,3),
...... snip the middle lines.
(4,5,6),
(7,8,9);
<<<<<<<<<<<<
> > It smells to missing parentheses. If you use some editor witch matches
> > them, try adding one BEFORE the semicolon. If it matches something
> > above you've got it.
> Here're the last two lines:
> (2297,1,'Principal place of business','600 SE Bay Boulevard',null,'Newport','OR','97365','541-265-7758','541-265-4235',null),
> (2298,1,'Principal place of business','7200 NE Airport Way',null,'Portland','OR','97218',null,null,null);
> And psql found a few missing terminating parentheses and commas which were
> fixed. I expected this last run to successfully complete.
Good luck. BTW, if you know a bit of scripting in perl/awk/python
whatever, it's normally useful to generate big insertion queries
programatically, to avoid mismatched quotes problems. And if your
editor is half-decent ad you have th disk space you can normally try
to make a big file, create an empty table like the target one, insert
into so you can bisect the input ( and once you have everything in
spool tables you just insert the whole table into the final one and
drop it ).
I mean, you do "create table location_tmp like locations". Then, split
your input files into easily managed ones, say some thousand lines.
Insert every file into tmp, do bisections on the ones which fail to
find errors. Once you have everything in tmp just insert from it into
final table.
Francisco Olarte.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Another user error?
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
@ 2020-11-01 19:00 ` Rich Shepard <rshepard@appl-ecosys.com>
3 siblings, 0 replies; 10+ messages in thread
From: Rich Shepard @ 2020-11-01 19:00 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On Sun, 1 Nov 2020, Rich Shepard wrote:
> Every line prior to this one is terminated with a colon. All other syntax
> errors have been corrected.
Er, that's comma, not colon. Need to recaffinate.
Rich
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Another user error?
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
@ 2020-11-01 19:13 ` David G. Johnston <david.g.johnston@gmail.com>
3 siblings, 0 replies; 10+ messages in thread
From: David G. Johnston @ 2020-11-01 19:13 UTC (permalink / raw)
To: Rich Shepard <rshepard@appl-ecosys.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
On Sun, Nov 1, 2020 at 11:54 AM Rich Shepard <rshepard@appl-ecosys.com>
wrote:
> When trying to populate the locations table I get this error:
> psql:locations.sql:2105: ERROR: syntax error at or near ";"
> LINE 2105: ...E Airport Way',null,'Portland','OR','97218',null,null,null);
> ^
> Line 2105 is the last line in the file and is terminated with the only
> semi-colon in the file. Every line prior to this one is terminated with a
> colon. All other syntax errors have been corrected.
>
> I've not encountered this issue before. Where should I look for the error?
>
You encountered and asked on this exact same issue Friday...the advice in
that "Multi-row insert: error at terminal row." all still applies.
David J.
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2020-11-01 19:46 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-01 18:53 Another user error? Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 18:57 ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-11-01 18:59 ` Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 18:59 ` Francisco Olarte <folarte@peoplecall.com>
2020-11-01 19:04 ` Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 19:10 ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-11-01 19:43 ` Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 19:46 ` Francisco Olarte <folarte@peoplecall.com>
2020-11-01 19:00 ` Rich Shepard <rshepard@appl-ecosys.com>
2020-11-01 19:13 ` David G. Johnston <david.g.johnston@gmail.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