Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error troubleshooting to pg_dump #1041

Merged
merged 3 commits into from
Jul 26, 2022
Merged

Conversation

charislam
Copy link
Contributor

Description

Add troubleshooting section to list safely ignorable pg_dump errors so users don't worry when they see these.

Version

Which documentation version does this PR apply to?

  • Latest (Default)
  • Version 1.7
  • Older [specify]

Links

Fixes #1040

@charislam charislam requested review from jfjoly and a team April 27, 2022 15:34
@charislam charislam self-assigned this Apr 27, 2022
@github-actions
Copy link

Please allow 10 minutes from last push for the staging site to build. For internal reviewers, check web-documentation repo actions for staging build status. Link to build for this PR: http://docs-dev.timescale.com/docs-charis-pg_dump-errors

@Loquacity
Copy link
Contributor

@charislam Can we merge this one now?

@charislam
Copy link
Contributor Author

Still need an SME to double-check quickly, I'll ping JF on Slack!

@Rajakavitha1
Copy link
Contributor

Still need an SME to double-check quickly, I'll ping JF on Slack!

Hi @charislam I tried a pg_dump and yes these messages appear and the restore worked so we could safely ignore these messages.

pg_dump: dumping contents of table "_timescaledb_internal._hyper_1_2_chunk"
pg_dump: dumping contents of table "_timescaledb_internal._hyper_1_3_chunk"
pg_dump: dumping contents of table "_timescaledb_internal._hyper_1_4_chunk"
pg_dump: dumping contents of table "_timescaledb_internal._hyper_1_5_chunk"
pg_dump: dumping contents of table "public.company"
pg_dump: dumping contents of table "public.stocks_real_time"
pg_dump: NOTICE:  hypertable data are in the chunks, no data will be copied
DETAIL:  Data for hypertables are stored in the chunks of a hypertable so COPY TO of a hypertable will not copy any data.
HINT:  Use "COPY (SELECT * FROM <hypertable>) TO ..." to copy all data in hypertable, or copy each chunk individually.
rajakavithakodhandapani@Rajakavithas-MacBook-Pro-2 ~ % pg_restore -d 'postgres://tsdbadmin:AVNS_RDuKYsXQuDcRdxiY02r@tsdb-2bbc6bef-krajakavitha-9697.a.timescaledb.io:19335/defaultdb?sslmode=require' --jobs 2 tsdb3.dump
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 4142; 0 0 COMMENT EXTENSION timescaledb 
pg_restore: error: could not execute query: ERROR:  must be owner of extension timescaledb
Command was: COMMENT ON EXTENSION timescaledb IS 'Enables scalable inserts and complex queries for time-series data';


pg_restore: from TOC entry 261; 1259 33987 TABLE stocks_real_time postgres
pg_restore: error: could not execute query: ERROR:  relation "stocks_real_time" already exists
Command was: CREATE TABLE public.stocks_real_time (
    "time" timestamp with time zone NOT NULL,
    symbol text NOT NULL,
    price double precision,
    day_volume integer
);


pg_restore: error: could not execute query: ERROR:  must be member of role "postgres"
Command was: ALTER TABLE public.stocks_real_time OWNER TO postgres;

pg_restore: from TOC entry 263; 1259 34000 TABLE _hyper_1_1_chunk postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_1_chunk" already exists
Command was: CREATE TABLE _timescaledb_internal._hyper_1_1_chunk (
    CONSTRAINT constraint_1 CHECK ((("time" >= '2022-06-16 05:30:00+05:30'::timestamp with time zone) AND ("time" < '2022-06-23 05:30:00+05:30'::timestamp with time zone)))
)
INHERITS (public.stocks_real_time);


pg_restore: error: could not execute query: ERROR:  operation not supported on chunk tables
Command was: ALTER TABLE _timescaledb_internal._hyper_1_1_chunk OWNER TO postgres;

pg_restore: from TOC entry 264; 1259 34008 TABLE _hyper_1_2_chunk postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_2_chunk" already exists
Command was: CREATE TABLE _timescaledb_internal._hyper_1_2_chunk (
    CONSTRAINT constraint_2 CHECK ((("time" >= '2022-06-23 05:30:00+05:30'::timestamp with time zone) AND ("time" < '2022-06-30 05:30:00+05:30'::timestamp with time zone)))
)
INHERITS (public.stocks_real_time);


pg_restore: error: could not execute query: ERROR:  operation not supported on chunk tables
Command was: ALTER TABLE _timescaledb_internal._hyper_1_2_chunk OWNER TO postgres;

pg_restore: from TOC entry 265; 1259 34016 TABLE _hyper_1_3_chunk postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_3_chunk" already exists
Command was: CREATE TABLE _timescaledb_internal._hyper_1_3_chunk (
    CONSTRAINT constraint_3 CHECK ((("time" >= '2022-06-30 05:30:00+05:30'::timestamp with time zone) AND ("time" < '2022-07-07 05:30:00+05:30'::timestamp with time zone)))
)
INHERITS (public.stocks_real_time);


pg_restore: error: could not execute query: ERROR:  operation not supported on chunk tables
Command was: ALTER TABLE _timescaledb_internal._hyper_1_3_chunk OWNER TO postgres;

pg_restore: from TOC entry 266; 1259 34024 TABLE _hyper_1_4_chunk postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_4_chunk" already exists
Command was: CREATE TABLE _timescaledb_internal._hyper_1_4_chunk (
    CONSTRAINT constraint_4 CHECK ((("time" >= '2022-07-07 05:30:00+05:30'::timestamp with time zone) AND ("time" < '2022-07-14 05:30:00+05:30'::timestamp with time zone)))
)
INHERITS (public.stocks_real_time);


pg_restore: error: could not execute query: ERROR:  operation not supported on chunk tables
Command was: ALTER TABLE _timescaledb_internal._hyper_1_4_chunk OWNER TO postgres;

pg_restore: from TOC entry 267; 1259 34032 TABLE _hyper_1_5_chunk postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_5_chunk" already exists
Command was: CREATE TABLE _timescaledb_internal._hyper_1_5_chunk (
    CONSTRAINT constraint_5 CHECK ((("time" >= '2022-07-14 05:30:00+05:30'::timestamp with time zone) AND ("time" < '2022-07-21 05:30:00+05:30'::timestamp with time zone)))
)
INHERITS (public.stocks_real_time);


pg_restore: error: could not execute query: ERROR:  operation not supported on chunk tables
Command was: ALTER TABLE _timescaledb_internal._hyper_1_5_chunk OWNER TO postgres;

pg_restore: from TOC entry 262; 1259 33995 TABLE company postgres
pg_restore: error: could not execute query: ERROR:  relation "company" already exists
Command was: CREATE TABLE public.company (
    symbol text NOT NULL,
    name text NOT NULL
);


pg_restore: error: could not execute query: ERROR:  must be member of role "postgres"
Command was: ALTER TABLE public.company OWNER TO postgres;

pg_restore: from TOC entry 4133; 0 34016 TABLE DATA _hyper_1_3_chunk postgres
pg_restore: error: COPY failed for table "_hyper_1_3_chunk": ERROR:  invalid INSERT on the root table of hypertable "_hyper_1_3_chunk"
HINT:  Make sure the TimescaleDB extension has been preloaded.
CONTEXT:  COPY _hyper_1_3_chunk, line 1: "2022-06-30 13:30:00+05:30	NVDA	152.67	\N"
pg_restore: from TOC entry 3972; 1259 34023 INDEX _hyper_1_3_chunk_ix_symbol_time postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_3_chunk_ix_symbol_time" already exists
Command was: CREATE INDEX _hyper_1_3_chunk_ix_symbol_time ON _timescaledb_internal._hyper_1_3_chunk USING btree (symbol, "time" DESC);


pg_restore: from TOC entry 3973; 1259 34022 INDEX _hyper_1_3_chunk_stocks_real_time_time_idx postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_3_chunk_stocks_real_time_time_idx" already exists
Command was: CREATE INDEX _hyper_1_3_chunk_stocks_real_time_time_idx ON _timescaledb_internal._hyper_1_3_chunk USING btree ("time" DESC);


pg_restore: from TOC entry 4132; 0 34008 TABLE DATA _hyper_1_2_chunk postgres
pg_restore: error: COPY failed for table "_hyper_1_2_chunk": ERROR:  invalid INSERT on the root table of hypertable "_hyper_1_2_chunk"
HINT:  Make sure the TimescaleDB extension has been preloaded.
CONTEXT:  COPY _hyper_1_2_chunk, line 1: "2022-06-23 13:30:02+05:30	JPM	114.27	\N"
pg_restore: from TOC entry 3970; 1259 34015 INDEX _hyper_1_2_chunk_ix_symbol_time postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_2_chunk_ix_symbol_time" already exists
Command was: CREATE INDEX _hyper_1_2_chunk_ix_symbol_time ON _timescaledb_internal._hyper_1_2_chunk USING btree (symbol, "time" DESC);


pg_restore: from TOC entry 3971; 1259 34014 INDEX _hyper_1_2_chunk_stocks_real_time_time_idx postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_2_chunk_stocks_real_time_time_idx" already exists
Command was: CREATE INDEX _hyper_1_2_chunk_stocks_real_time_time_idx ON _timescaledb_internal._hyper_1_2_chunk USING btree ("time" DESC);


pg_restore: from TOC entry 4134; 0 34024 TABLE DATA _hyper_1_4_chunk postgres
pg_restore: error: COPY failed for table "_hyper_1_4_chunk": ERROR:  invalid INSERT on the root table of hypertable "_hyper_1_4_chunk"
HINT:  Make sure the TimescaleDB extension has been preloaded.
CONTEXT:  COPY _hyper_1_4_chunk, line 1: "2022-07-07 13:30:00+05:30	AMD	76	\N"
pg_restore: from TOC entry 3974; 1259 34031 INDEX _hyper_1_4_chunk_ix_symbol_time postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_4_chunk_ix_symbol_time" already exists
Command was: CREATE INDEX _hyper_1_4_chunk_ix_symbol_time ON _timescaledb_internal._hyper_1_4_chunk USING btree (symbol, "time" DESC);


pg_restore: from TOC entry 3975; 1259 34030 INDEX _hyper_1_4_chunk_stocks_real_time_time_idx postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_4_chunk_stocks_real_time_time_idx" already exists
Command was: CREATE INDEX _hyper_1_4_chunk_stocks_real_time_time_idx ON _timescaledb_internal._hyper_1_4_chunk USING btree ("time" DESC);


pg_restore: from TOC entry 4135; 0 34032 TABLE DATA _hyper_1_5_chunk postgres
pg_restore: error: COPY failed for table "_hyper_1_5_chunk": ERROR:  invalid INSERT on the root table of hypertable "_hyper_1_5_chunk"
HINT:  Make sure the TimescaleDB extension has been preloaded.
CONTEXT:  COPY _hyper_1_5_chunk, line 1: "2022-07-14 13:30:00+05:30	AMD	77.3	\N"
pg_restore: from TOC entry 3976; 1259 34039 INDEX _hyper_1_5_chunk_ix_symbol_time postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_5_chunk_ix_symbol_time" already exists
Command was: CREATE INDEX _hyper_1_5_chunk_ix_symbol_time ON _timescaledb_internal._hyper_1_5_chunk USING btree (symbol, "time" DESC);


pg_restore: from TOC entry 3977; 1259 34038 INDEX _hyper_1_5_chunk_stocks_real_time_time_idx postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_5_chunk_stocks_real_time_time_idx" already exists
Command was: CREATE INDEX _hyper_1_5_chunk_stocks_real_time_time_idx ON _timescaledb_internal._hyper_1_5_chunk USING btree ("time" DESC);


pg_restore: from TOC entry 4131; 0 34000 TABLE DATA _hyper_1_1_chunk postgres
pg_restore: error: COPY failed for table "_hyper_1_1_chunk": ERROR:  invalid INSERT on the root table of hypertable "_hyper_1_1_chunk"
HINT:  Make sure the TimescaleDB extension has been preloaded.
CONTEXT:  COPY _hyper_1_1_chunk, line 1: "2022-06-23 05:29:58+05:30	SQ	59.65	\N"
pg_restore: from TOC entry 3968; 1259 34007 INDEX _hyper_1_1_chunk_ix_symbol_time postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_1_chunk_ix_symbol_time" already exists
Command was: CREATE INDEX _hyper_1_1_chunk_ix_symbol_time ON _timescaledb_internal._hyper_1_1_chunk USING btree (symbol, "time" DESC);


pg_restore: from TOC entry 3969; 1259 34006 INDEX _hyper_1_1_chunk_stocks_real_time_time_idx postgres
pg_restore: error: could not execute query: ERROR:  relation "_hyper_1_1_chunk_stocks_real_time_time_idx" already exists
Command was: CREATE INDEX _hyper_1_1_chunk_stocks_real_time_time_idx ON _timescaledb_internal._hyper_1_1_chunk USING btree ("time" DESC);


pg_restore: from TOC entry 3833; 0 33396 TABLE DATA hypertable postgres
pg_restore: error: COPY failed for table "hypertable": ERROR:  duplicate key value violates unique constraint "hypertable_pkey"
DETAIL:  Key (id)=(1) already exists.
CONTEXT:  COPY hypertable, line 1
pg_restore: from TOC entry 3840; 0 33477 TABLE DATA chunk postgres
pg_restore: error: COPY failed for table "chunk": ERROR:  duplicate key value violates unique constraint "chunk_pkey"
DETAIL:  Key (id)=(1) already exists.
CONTEXT:  COPY chunk, line 1
pg_restore: from TOC entry 3848; 0 33587 TABLE DATA metadata postgres
pg_restore: error: COPY failed for table "metadata": ERROR:  duplicate key value violates unique constraint "metadata_pkey"
DETAIL:  Key (key)=(exported_uuid) already exists.
CONTEXT:  COPY metadata, line 1
pg_restore: from TOC entry 3836; 0 33444 TABLE DATA dimension postgres
pg_restore: error: COPY failed for table "dimension": ERROR:  duplicate key value violates unique constraint "dimension_pkey"
DETAIL:  Key (id)=(1) already exists.
CONTEXT:  COPY dimension, line 1
pg_restore: from TOC entry 3966; 1259 33994 INDEX ix_symbol_time postgres
pg_restore: error: could not execute query: ERROR:  chunk not found
DETAIL:  schema_name: _timescaledb_internal, table_name: _hyper_1_10_chunk
Command was: CREATE INDEX ix_symbol_time ON public.stocks_real_time USING btree (symbol, "time" DESC);


pg_restore: from TOC entry 3967; 1259 33993 INDEX stocks_real_time_time_idx postgres
pg_restore: error: could not execute query: ERROR:  chunk not found
DETAIL:  schema_name: _timescaledb_internal, table_name: _hyper_1_10_chunk
Command was: CREATE INDEX stocks_real_time_time_idx ON public.stocks_real_time USING btree ("time" DESC);


pg_restore: from TOC entry 3978; 2620 33992 TRIGGER stocks_real_time ts_insert_blocker postgres
pg_restore: error: could not execute query: ERROR:  trigger "ts_insert_blocker" for relation "stocks_real_time" already exists
Command was: CREATE TRIGGER ts_insert_blocker BEFORE INSERT ON public.stocks_real_time FOR EACH ROW EXECUTE FUNCTION _timescaledb_internal.insert_blocker();


pg_restore: warning: errors ignored on restore: 59
rajakavithakodhandapani@Rajakavithas-MacBook-Pro-2 ~ % 

@charislam charislam force-pushed the charis/pg_dump-errors branch from 66a115f to 5efbf41 Compare July 25, 2022 19:12
@charislam charislam merged commit fa3c98f into latest Jul 26, 2022
@charislam charislam deleted the charis/pg_dump-errors branch July 26, 2022 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants