You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createdatabase db1
use db1
createtable tab1(col1 timestamp)
Then pg_dump fails on this DB:
PGPASSWORD=12345678 ./bin/pg_dump -h 127.0.0.1 -p 5432 -U jdbc_user --bbf-database-name db1 -f db1.sql jdbc_testdb
pg_dump: error: query failed: ERROR: column "col1" is a ROWVERSION/TIMESTAMP column
DETAIL: ROWVERSION/TIMESTAMP columns cannot be used in COPY.
pg_dump: detail: Query was: COPY db1_dbo.tab1 (col1) TO stdout;
At the same time, pg_dump works fine if we replace timestamp type with its synonym rowversion:
createdatabase db2
use db2
createtable tab2(col2 rowversion)
It appeared that this check in pg_dump passes for rowversion, but fails for timestamp. This happens because the type name for timestamp is fetched by pg_dump in a partially quoted form as an output of pg_catalog.format_type function (simplified query):
selectpg_catalog.format_type(typ.oid, null)
from pg_attribute att
join pg_type typ ontyp.oid=att.atttypidwhereatt.attrelid='db1_dbo.tab1'::regclass::oidandatt.attname='col1'
sys."timestamp"
Quotes are added around the timestamp type name in format_type implementation at this point because the timestamp (unlike the rowversion) is a Postgres keyword.
It is not immediately clear how to fix this issue - whether the timestamp/rowversion check can be extended in pg_dump, or whether the implementation of format_type needs a special case for sys.timestamp.
Version
BABEL_4_X_DEV (Default)
Extension
None
Which flavor of Linux are you using when you see the bug?
Fedora
Relevant log output
No response
Code of Conduct
I agree to follow this project's Code of Conduct.
The text was updated successfully, but these errors were encountered:
Hi @staticlibs, we actually recommend using --quote-all-identifiers option with pg_dump command, see here. I verified that pg_dump works well when --quote-all-identifiers option is used.
What happened?
With
rowversion
hatch enabled:If we create the following DB:
Then
pg_dump
fails on this DB:At the same time,
pg_dump
works fine if we replacetimestamp
type with its synonymrowversion
:It appeared that this check in pg_dump passes for
rowversion
, but fails fortimestamp
. This happens because the type name for timestamp is fetched bypg_dump
in a partially quoted form as an output ofpg_catalog.format_type
function (simplified query):Quotes are added around the
timestamp
type name informat_type
implementation at this point because thetimestamp
(unlike therowversion
) is a Postgres keyword.It is not immediately clear how to fix this issue - whether the
timestamp/rowversion
check can be extended inpg_dump
, or whether the implementation offormat_type
needs a special case forsys.timestamp
.Version
BABEL_4_X_DEV (Default)
Extension
None
Which flavor of Linux are you using when you see the bug?
Fedora
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: