mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 02:53:51 +08:00
Errors and messages are overhauled to conform to the official PostgreSQL style guide. In particular, the following things from the guide has been given special attention: * Correct capitalization of first letter: capitalize only for hints, and detail messages. * Correct handling of periods at the end of messages (should be elided for primary message, but not detail and hint messages). * The primary message should be short, factual, and avoid reference to implementation details such as specific function names. Some messages have also been reworded for clarity and to better conform with the last bullet above (short primary message). In other cases, messages have been updated to fix references to, e.g., function parameters that used the wrong parameter name. Closes #2364
63 lines
2.8 KiB
C
63 lines
2.8 KiB
C
/*
|
|
* This file and its contents are licensed under the Apache License 2.0.
|
|
* Please see the included NOTICE for copyright information and
|
|
* LICENSE-APACHE for a copy of the license.
|
|
*/
|
|
/* Defines error codes used
|
|
-- PREFIX TS
|
|
*/
|
|
|
|
/*
|
|
-- TS000 - GROUP: query errors
|
|
-- TS001 - hypertable does not exist
|
|
-- TS002 - column does not exist
|
|
*/
|
|
#define ERRCODE_TS_QUERY_ERRORS MAKE_SQLSTATE('T', 'S', '0', '0', '0')
|
|
#define ERRCODE_TS_HYPERTABLE_NOT_EXIST MAKE_SQLSTATE('T', 'S', '0', '0', '1')
|
|
#define ERRCODE_TS_DIMENSION_NOT_EXIST MAKE_SQLSTATE('T', 'S', '0', '0', '2')
|
|
#define ERRCODE_TS_CHUNK_NOT_EXIST MAKE_SQLSTATE('T', 'S', '0', '0', '3')
|
|
|
|
/*
|
|
--TS100 - GROUP: DDL errors
|
|
--TS101 - operation not supported
|
|
--TS102 - bad hypertable definition
|
|
--TS103 - bad hypertable index definition
|
|
--TS110 - hypertable already exists
|
|
--TS111 - hypertable is not distributed
|
|
--TS120 - node already exists
|
|
--TS130 - user already exists
|
|
--TS140 - tablespace already attached
|
|
--TS150 - tablespace not attached
|
|
--TS160 - duplicate dimension
|
|
--TS170 - no data nodes
|
|
--TS180 - data node assignment already exists
|
|
--TS190 - data node not attached
|
|
*/
|
|
#define ERRCODE_TS_DDL_ERRORS MAKE_SQLSTATE('T', 'S', '1', '0', '0')
|
|
#define ERRCODE_TS_OPERATION_NOT_SUPPORTED MAKE_SQLSTATE('T', 'S', '1', '0', '1')
|
|
#define ERRCODE_TS_BAD_HYPERTABLE_DEFINITION MAKE_SQLSTATE('T', 'S', '1', '0', '2')
|
|
#define ERRCODE_TS_BAD_HYPERTABLE_INDEX_DEFINITION MAKE_SQLSTATE('T', 'S', '1', '0', '3')
|
|
#define ERRCODE_TS_HYPERTABLE_EXISTS MAKE_SQLSTATE('T', 'S', '1', '1', '0')
|
|
#define ERRCODE_TS_HYPERTABLE_NOT_DISTRIBUTED MAKE_SQLSTATE('T', 'S', '1', '1', '1')
|
|
#define ERRCODE_TS_NODE_EXISTS MAKE_SQLSTATE('T', 'S', '1', '2', '0')
|
|
#define ERRCODE_TS_USER_EXISTS MAKE_SQLSTATE('T', 'S', '1', '3', '0')
|
|
#define ERRCODE_TS_TABLESPACE_ALREADY_ATTACHED MAKE_SQLSTATE('T', 'S', '1', '4', '0')
|
|
#define ERRCODE_TS_TABLESPACE_NOT_ATTACHED MAKE_SQLSTATE('T', 'S', '1', '5', '0')
|
|
#define ERRCODE_TS_DUPLICATE_DIMENSION MAKE_SQLSTATE('T', 'S', '1', '6', '0')
|
|
#define ERRCODE_TS_INSUFFICIENT_NUM_DATA_NODES MAKE_SQLSTATE('T', 'S', '1', '7', '0')
|
|
#define ERRCODE_TS_DATA_NODE_ASSIGNMENT_ALREADY_EXISTS MAKE_SQLSTATE('T', 'S', '1', '7', '1')
|
|
#define ERRCODE_TS_DATA_NODE_ALREADY_ATTACHED MAKE_SQLSTATE('T', 'S', '1', '7', '2')
|
|
#define ERRCODE_TS_DATA_NODE_NOT_ATTACHED MAKE_SQLSTATE('T', 'S', '1', '7', '3')
|
|
#define ERRCODE_TS_DATA_NODE_INVALID_CONFIG MAKE_SQLSTATE('T', 'S', '1', '7', '4')
|
|
|
|
/*
|
|
--IO500 - GROUP: internal error
|
|
--IO501 - unexpected state/event
|
|
--IO502 - communication/remote error
|
|
*/
|
|
#define ERRCODE_TS_INTERNAL_ERROR MAKE_SQLSTATE('T', 'S', '5', '0', '0')
|
|
#define ERRCODE_TS_UNEXPECTED MAKE_SQLSTATE('T', 'S', '5', '0', '1')
|
|
#define ERRCODE_TS_COMMUNICATION_ERROR MAKE_SQLSTATE('T', 'S', '5', '0', '2')
|
|
#define ERRCODE_TS_CHUNK_COLLISION MAKE_SQLSTATE('T', 'S', '5', '0', '3')
|
|
#define ERRCODE_TS_DATA_NODE_IN_USE MAKE_SQLSTATE('T', 'S', '5', '0', '4')
|