pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedbug in psql?
10+ messages / 5 participants
[nested] [flat]
* bug in psql?
@ 2000-07-24 12:52 Peter Keller <peter.keller@bvv.bayern.de>
0 siblings, 1 reply; 10+ messages in thread
From: Peter Keller @ 2000-07-24 12:52 UTC (permalink / raw)
To: pgsql-general
Hello all,
is there a bug in psql (PostgreSQL 7.0.2 on i686-pc-linux-gnu)?
When I start psql with the command -F $ (or any other saparator) the
output is still with the separator |.
When I do a \pset in psql I get the same wrong result.
Example:
test=# \pset fieldsep $
Field separator is '$'.
test=# SELECT * from fltl;
obnr | objtyp |
-------+--------+
1764a | FLTL |
1772a | FLTL |
Any ideas?
Peter
--
Bezirksfinanzdirektion Muenchen
Vermessungsabteilung
.........................................................
Peter Keller : Tel: (+49) 089-2190-2594
Vermessungsrat z.A.: Fax: (+49) 089-2190-2459
Alexandrastr. 3 : mailto:Peter.Keller@bvv.bayern.de
80538 Muenchen : web: http://www.bayern.de/vermessung
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: bug in psql?
@ 2000-07-24 14:29 Holger Klawitter <holger@klawitter.de>
parent: Peter Keller <peter.keller@bvv.bayern.de>
0 siblings, 0 replies; 10+ messages in thread
From: Holger Klawitter @ 2000-07-24 14:29 UTC (permalink / raw)
To: pgsql-general
> When I start psql with the command -F $ (or any other saparator) the
> output is still with the separator |.
\f is only being honored when field alignment (\a) is turned off.
Dunno, whether this is intended.
Regards,
Mit freundlichem Gruß,
Holger Klawitter
--
Holger Klawitter +49 (0)251 484 0637
holger@klawitter.de http://www.klawitter.de/
^ permalink raw reply [nested|flat] 10+ messages in thread
* bug in psql?
@ 2020-08-15 05:35 Aleksey M Boltenkov <holybolt@rambler.ru>
0 siblings, 2 replies; 10+ messages in thread
From: Aleksey M Boltenkov @ 2020-08-15 05:35 UTC (permalink / raw)
To: pgsql-general
Is this a bug?
Executing of malformed (quote symbols) select in psql results in unexpected
behaviour:
pg01:5432 postgres@db=# select 'any expression'any expression\d+;
List of relations
Schema │ Name │ Type │ Owner │ Size │ Description
════════╪══════════════════════════╪══════════╪══════════╪════════════╪══════════════
public │ geography_columns │ view │ postgres │ 0 bytes │
public │ geometry_columns │ view │ postgres │ 0 bytes │
public │ pg_buffercache │ view │ postgres │ 0 bytes │
public │ pg_stat_statements │ view │ postgres │ 0 bytes │
public │ raster_columns │ view │ postgres │ 0 bytes │
public │ raster_overviews │ view │ postgres │ 0 bytes │
public │ spatial_ref_sys │ table │ postgres │ 4616 kB │
...
Aleksey M Boltenkov.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: bug in psql?
@ 2020-08-15 05:38 Pavel Stehule <pavel.stehule@gmail.com>
parent: Aleksey M Boltenkov <holybolt@rambler.ru>
1 sibling, 1 reply; 10+ messages in thread
From: Pavel Stehule @ 2020-08-15 05:38 UTC (permalink / raw)
To: Aleksey M Boltenkov <holybolt@rambler.ru>; +Cc: pgsql-general
so 15. 8. 2020 v 7:35 odesílatel Aleksey M Boltenkov <holybolt@rambler.ru>
napsal:
> Is this a bug?
>
> Executing of malformed (quote symbols) select in psql results in
> unexpected behaviour:
>
> pg01:5432 postgres@db=# select 'any expression'any expression\d+;
> List of relations
> Schema │ Name │ Type │ Owner │ Size │ Description
>
> ════════╪══════════════════════════╪══════════╪══════════╪════════════╪══════════════
> public │ geography_columns │ view │ postgres │ 0 bytes │
> public │ geometry_columns │ view │ postgres │ 0 bytes │
> public │ pg_buffercache │ view │ postgres │ 0 bytes │
> public │ pg_stat_statements │ view │ postgres │ 0 bytes │
> public │ raster_columns │ view │ postgres │ 0 bytes │
> public │ raster_overviews │ view │ postgres │ 0 bytes │
> public │ spatial_ref_sys │ table │ postgres │ 4616 kB │
> ...
>
I tested psql-12 and psql-14 and I don't see this issue
Pavel
>
> Aleksey M Boltenkov.
>
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: bug in psql?
@ 2020-08-15 05:56 Tom Lane <tgl@sss.pgh.pa.us>
parent: Aleksey M Boltenkov <holybolt@rambler.ru>
1 sibling, 1 reply; 10+ messages in thread
From: Tom Lane @ 2020-08-15 05:56 UTC (permalink / raw)
To: Aleksey M Boltenkov <holybolt@rambler.ru>; +Cc: pgsql-general
"Aleksey M Boltenkov" <holybolt@rambler.ru> writes:
> Is this a bug?
> pg01:5432 postgres@db=# select 'any expression'any expression\d+;
No. The "\d+;" is taken as a backslash command, and is executed.
The rest of what you typed is still waiting in the query buffer.
It's bit weird perhaps, since \d seems like a "do-something"
command rather than a query buffer editing command. But
psql uses the same rules for both cases.
regards, tom lane
^ permalink raw reply [nested|flat] 10+ messages in thread
* RE: bug in psql?
@ 2020-08-15 06:35 Aleksey M Boltenkov <holybolt@rambler.ru>
parent: Pavel Stehule <pavel.stehule@gmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: Aleksey M Boltenkov @ 2020-08-15 06:35 UTC (permalink / raw)
To: pavel.stehule@gmail.com; +Cc: pgsql-general
eksey M Boltenkov.
15.08.2020, 08:39, Pavel Stehule <pavel.stehule@gmail.com>
so 15. 8. 2020 v 7:35 odesílatel Aleksey M Boltenkov <holybolt@rambler.ru>
napsal:
Is this a bug?
Executing of malformed (quote symbols) select in psql results in
unexpected behaviour:
pg01:5432 postgres@db=# select 'any expression'any expression\d+;
List of relations
Schema │ Name │ Type │ Owner │ Size │ Description
════════╪══════════════════════════╪══════════╪══════════╪════════════╪══════════════
public │ geography_columns │ view │ postgres │ 0 bytes │
public │ geometry_columns │ view │ postgres │ 0 bytes │
public │ pg_buffercache │ view │ postgres │ 0 bytes │
public │ pg_stat_statements │ view │ postgres │ 0 bytes │
public │ raster_columns │ view │ postgres │ 0 bytes │
public │ raster_overviews │ view │ postgres │ 0 bytes │
public │ spatial_ref_sys │ table │ postgres │ 4616 kB │
...
I tested psql-12 and psql-14 and I don't see this issue
Pavel
Aleksey M Boltenkov.
You must have relations in search path, ifaiu.
engineer@pg02:~$ psql -U postgres -h localhost -p 5432 kaad
SET
Timing is on.
Null display is "¤".
Line style is unicode.
Unicode border line style is "single".
Unicode column line style is "single".
Unicode header line style is "double".
Output format is wrapped.
SET
Time: 0.234 ms
SET
Time: 0.206 ms
psql (12.4 (Ubuntu 12.4-1.pgdg18.04+1))
Type "help" for help.2020-08-15 09:29:18 localhost:5432 postgres@kaad=# select
version();
version
═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
PostgreSQL 12.4 (Ubuntu 12.4-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
(1 row)Time: 6.682 ms
2020-08-15 09:29:24 localhost:5432 postgres@kaad=# select 'any expression'any
expression\d+;
List of relations
Schema │ Name │ Type │ Owner │ Size │ Description
════════╪═══════════════════╪═══════╪══════════╪═════════╪═════════════
public │ geography_columns │ view │ postgres │ 0 bytes │
public │ geometry_columns │ view │ postgres │ 0 bytes │
public │ raster_columns │ view │ postgres │ 0 bytes │
public │ raster_overviews │ view │ postgres │ 0 bytes │
public │ spatial_ref_sys │ table │ postgres │ 4616 kB │
(5 rows)[more] - > ; -- semicolon is manually added
ERROR: 42601: syntax error at or near "any"
LINE 1: select 'any expression'any expression
^
LOCATION: scanner_yyerror, scan.l:1149
Time: 0.530 ms
Aleksey M Boltenkov.
^ permalink raw reply [nested|flat] 10+ messages in thread
* RE: bug in psql?
@ 2020-08-15 06:46 Aleksey M Boltenkov <holybolt@rambler.ru>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 10+ messages in thread
From: Aleksey M Boltenkov @ 2020-08-15 06:46 UTC (permalink / raw)
To: tgl@sss.pgh.pa.us; +Cc: pgsql-general
15.08.2020, 08:56, Tom Lane <tgl@sss.pgh.pa.us>"Aleksey M Boltenkov" <holybolt@rambler.ru>
writes:
> Is this a bug?
> pg01:5432 postgres@db=# select 'any expression'any expression\d+;
No. The "\d+;" is taken as a backslash command, and is executed.
The rest of what you typed is still waiting in the query buffer.
It's bit weird perhaps, since \d seems like a "do-something"
command rather than a query buffer editing command. But
psql uses the same rules for both cases.
regards, tom lane
Yes, i have used it for a long, but it was always wellformed, so malformed query
was some kind of surprise.
select format('insert into x.y ( field, ... ) select val, ... from %I.%I on
conflict ( constraint ) do nothing;\dti+ x.y*', (regexp_match(tablename,
'\d[\d_]+$'))[1], schemaname, tablename) from pg_tables where schemaname = 'x'
and tablename ~ '^y' order by 1;
insert into x.y ( field, ... ) select '2020_07_29'::date, field, ... from
x.y_archive_2020_07_29 on conflict ( constraint ) do nothing;\dti+
x.y_new_scheme*
insert into x.y ( field, ... ) select '2020_08_05'::date, field, ... from
x.y_archive_2020_08_05 on conflict ( constraint ) do nothing;\dti+
x.y_new_scheme*
insert into x.y ( field, ... ) select '2020_08_12'::date, field, ... from
x.y_archive_2020_08_12 on conflict ( constraint ) do nothing;\dti+
x.y_new_scheme*
\gexec
Aleksey M Boltenkov.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: bug in psql?
@ 2020-08-15 06:49 Pavel Stehule <pavel.stehule@gmail.com>
parent: Aleksey M Boltenkov <holybolt@rambler.ru>
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Stehule @ 2020-08-15 06:49 UTC (permalink / raw)
To: Aleksey M Boltenkov <holybolt@rambler.ru>; +Cc: pgsql-general
so 15. 8. 2020 v 8:35 odesílatel Aleksey M Boltenkov <holybolt@rambler.ru>
napsal:
> eksey M Boltenkov.
>
> 15.08.2020, 08:39, Pavel Stehule <pavel.stehule@gmail.com>
>
>
> so 15. 8. 2020 v 7:35 odesílatel Aleksey M Boltenkov <holybolt@rambler.ru>
> napsal:
>
>> Is this a bug?
>>
>> Executing of malformed (quote symbols) select in psql results in
>> unexpected behaviour:
>>
>> pg01:5432 postgres@db=# select 'any expression'any expression\d+;
>> List of relations
>> Schema │ Name │ Type │ Owner │ Size │ Description
>>
>> ════════╪══════════════════════════╪══════════╪══════════╪════════════╪══════════════
>> public │ geography_columns │ view │ postgres │ 0 bytes │
>> public │ geometry_columns │ view │ postgres │ 0 bytes │
>> public │ pg_buffercache │ view │ postgres │ 0 bytes │
>> public │ pg_stat_statements │ view │ postgres │ 0 bytes │
>> public │ raster_columns │ view │ postgres │ 0 bytes │
>> public │ raster_overviews │ view │ postgres │ 0 bytes │
>> public │ spatial_ref_sys │ table │ postgres │ 4616 kB │
>> ...
>>
>
> I tested psql-12 and psql-14 and I don't see this issue
>
> Pavel
>
>
>>
>> Aleksey M Boltenkov.
>>
>>
>>
> You must have relations in search path, ifaiu.
>
> engineer@pg02:~$ psql -U postgres -h localhost -p 5432 kaad
> SET
> Timing is on.
> Null display is "¤".
> Line style is unicode.
> Unicode border line style is "single".
> Unicode column line style is "single".
> Unicode header line style is "double".
> Output format is wrapped.
> SET
> Time: 0.234 ms
> SET
> Time: 0.206 ms
> psql (12.4 (Ubuntu 12.4-1.pgdg18.04+1))
> Type "help" for help.
> 2020-08-15 09:29:18 localhost:5432 postgres@kaad=# select version();
> version
>
> ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
> PostgreSQL 12.4 (Ubuntu 12.4-1.pgdg18.04+1) on x86_64-pc-linux-gnu,
> compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
> (1 row)
> Time: 6.682 ms
> 2020-08-15 09:29:24 localhost:5432 postgres@kaad=# select 'any
> expression'any expression\d+;
> List of relations
> Schema │ Name │ Type │ Owner │ Size │ Description
> ════════╪═══════════════════╪═══════╪══════════╪═════════╪═════════════
> public │ geography_columns │ view │ postgres │ 0 bytes │
> public │ geometry_columns │ view │ postgres │ 0 bytes │
> public │ raster_columns │ view │ postgres │ 0 bytes │
> public │ raster_overviews │ view │ postgres │ 0 bytes │
> public │ spatial_ref_sys │ table │ postgres │ 4616 kB │
> (5 rows)
> [more] - > ; -- semicolon is manually added
> ERROR: 42601: syntax error at or near "any"
> LINE 1: select 'any expression'any expression
> ^
> LOCATION: scanner_yyerror, scan.l:1149
> Time: 0.530 ms
>
it is expected result from my perspective
there is same error if you run your query without \d
postgres=# select 'any expression 'any expression;
ERROR: syntax error at or near "any"
LINE 1: select 'any expression 'any expression;
>
> Aleksey M Boltenkov.
>
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* RE: bug in psql?
@ 2020-08-15 06:51 Aleksey M Boltenkov <holybolt@rambler.ru>
parent: Aleksey M Boltenkov <holybolt@rambler.ru>
0 siblings, 0 replies; 10+ messages in thread
From: Aleksey M Boltenkov @ 2020-08-15 06:51 UTC (permalink / raw)
To: holybolt@rambler.ru; +Cc: pgsql-general; tgl@sss.pgh.pa.us
15.08.2020, 09:46, Aleksey M Boltenkov <holybolt@rambler.ru>
15.08.2020, 08:56, Tom Lane <tgl@sss.pgh.pa.us>"Aleksey M Boltenkov" <holybolt@rambler.ru>
writes:
> Is this a bug?
> pg01:5432 postgres@db=# select 'any expression'any expression\d+;
No. The "\d+;" is taken as a backslash command, and is executed.
The rest of what you typed is still waiting in the query buffer.
It's bit weird perhaps, since \d seems like a "do-something"
command rather than a query buffer editing command. But
psql uses the same rules for both cases.
regards, tom lane
Yes, i have used it for a long, but it was always wellformed, so malformed
query was some kind of surprise.
select format('insert into x.y ( field, ... ) select val, ... from %I.%I on
conflict ( constraint ) do nothing;\dti+ x.y*', (regexp_match(tablename,
'\d[\d_]+$'))[1], schemaname, tablename) from pg_tables where schemaname =
'x' and tablename ~ '^y' order by 1;
insert into x.y ( field, ... ) select '2020_07_29'::date, field, ... from
x.y_archive_2020_07_29 on conflict ( constraint ) do nothing;\dti+
x.y_new_scheme*
insert into x.y ( field, ... ) select '2020_08_05'::date, field, ... from
x.y_archive_2020_08_05 on conflict ( constraint ) do nothing;\dti+
x.y_new_scheme*
insert into x.y ( field, ... ) select '2020_08_12'::date, field, ... from
x.y_archive_2020_08_12 on conflict ( constraint ) do nothing;\dti+
x.y_new_scheme*
\gexec
Aleksey M Boltenkov.
Sorry, \gexec does not work, copy and paste.
Aleksey M Boltenkov.
^ permalink raw reply [nested|flat] 10+ messages in thread
* RE: bug in psql?
@ 2020-08-15 06:54 Aleksey M Boltenkov <holybolt@rambler.ru>
parent: Pavel Stehule <pavel.stehule@gmail.com>
0 siblings, 0 replies; 10+ messages in thread
From: Aleksey M Boltenkov @ 2020-08-15 06:54 UTC (permalink / raw)
To: pavel.stehule@gmail.com; +Cc: pgsql-general
15.08.2020, 09:49, Pavel Stehule <pavel.stehule@gmail.com>
so 15. 8. 2020 v 8:35 odesílatel Aleksey M Boltenkov <holybolt@rambler.ru>
napsal:
eksey M Boltenkov.
15.08.2020, 08:39, Pavel Stehule <pavel.stehule@gmail.com>
so 15. 8. 2020 v 7:35 odesílatel Aleksey M Boltenkov <holybolt@rambler.ru>
napsal:
Is this a bug?
Executing of malformed (quote symbols) select in psql results in
unexpected behaviour:
pg01:5432 postgres@db=# select 'any expression'any expression\d+;
List of relations
Schema │ Name │ Type │ Owner │ Size │ Description
════════╪══════════════════════════╪══════════╪══════════╪════════════╪══════════════
public │ geography_columns │ view │ postgres │ 0 bytes │
public │ geometry_columns │ view │ postgres │ 0 bytes │
public │ pg_buffercache │ view │ postgres │ 0 bytes │
public │ pg_stat_statements │ view │ postgres │ 0 bytes │
public │ raster_columns │ view │ postgres │ 0 bytes │
public │ raster_overviews │ view │ postgres │ 0 bytes │
public │ spatial_ref_sys │ table │ postgres │ 4616 kB │
...
I tested psql-12 and psql-14 and I don't see this issue
Pavel
Aleksey M Boltenkov.
You must have relations in search path, ifaiu.
engineer@pg02:~$ psql -U postgres -h localhost -p 5432 kaad
SET
Timing is on.
Null display is "¤".
Line style is unicode.
Unicode border line style is "single".
Unicode column line style is "single".
Unicode header line style is "double".
Output format is wrapped.
SET
Time: 0.234 ms
SET
Time: 0.206 ms
psql (12.4 (Ubuntu 12.4-1.pgdg18.04+1))
Type "help" for help.2020-08-15 09:29:18 localhost:5432 postgres@kaad=#
select version();
version
═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
PostgreSQL 12.4 (Ubuntu 12.4-1.pgdg18.04+1) on x86_64-pc-linux-gnu,
compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
(1 row)Time: 6.682 ms
2020-08-15 09:29:24 localhost:5432 postgres@kaad=# select 'any
expression'any expression\d+;
List of relations
Schema │ Name │ Type │ Owner │ Size │ Description
════════╪═══════════════════╪═══════╪══════════╪═════════╪═════════════
public │ geography_columns │ view │ postgres │ 0 bytes │
public │ geometry_columns │ view │ postgres │ 0 bytes │
public │ raster_columns │ view │ postgres │ 0 bytes │
public │ raster_overviews │ view │ postgres │ 0 bytes │
public │ spatial_ref_sys │ table │ postgres │ 4616 kB │
(5 rows)[more] - > ; -- semicolon is manually added
ERROR: 42601: syntax error at or near "any"
LINE 1: select 'any expression'any expression
^
LOCATION: scanner_yyerror, scan.l:1149
Time: 0.530 ms
it is expected result from my perspective
there is same error if you run your query without \d
postgres=# select 'any expression 'any expression;
ERROR: syntax error at or near "any"
LINE 1: select 'any expression 'any expression;
Aleksey M Boltenkov.
Thank you, i just was impressed by execution of part of malformed select
expression by psql as cli part.
Aleksey M Boltenkov.
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2020-08-15 06:54 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-07-24 12:52 bug in psql? Peter Keller <peter.keller@bvv.bayern.de>
2000-07-24 14:29 ` Holger Klawitter <holger@klawitter.de>
2020-08-15 05:35 bug in psql? Aleksey M Boltenkov <holybolt@rambler.ru>
2020-08-15 05:38 ` Pavel Stehule <pavel.stehule@gmail.com>
2020-08-15 06:35 ` Aleksey M Boltenkov <holybolt@rambler.ru>
2020-08-15 06:49 ` Pavel Stehule <pavel.stehule@gmail.com>
2020-08-15 06:54 ` Aleksey M Boltenkov <holybolt@rambler.ru>
2020-08-15 05:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-08-15 06:46 ` Aleksey M Boltenkov <holybolt@rambler.ru>
2020-08-15 06:51 ` Aleksey M Boltenkov <holybolt@rambler.ru>
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