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

type mismatch during creation table with default values #2034

Closed
dcherednik opened this issue Feb 16, 2024 · 2 comments
Closed

type mismatch during creation table with default values #2034

dcherednik opened this issue Feb 16, 2024 · 2 comments
Assignees

Comments

@dcherednik
Copy link
Member

local=> CREATE TABLE alert_configuration (
local(> id integer NOT NULL,
local(> alertmanager_configuration text NOT NULL,
local(> configuration_version character varying(3) NOT NULL,
local(> created_at integer NOT NULL,
local(> "default" boolean DEFAULT false NOT NULL,
local(> org_id bigint DEFAULT 0 NOT NULL,
local(> configuration_hash character varying(32) DEFAULT 'not-yet-calculated'::character varying NOT NULL,
local(> PRIMARY KEY (id)
local(> );
Status: GENERIC_ERROR
Issues:

: Error: Type annotation, code: 1030 :1:1: Error: At function: KiCreateTable! :1:1: Error: Default expr org_id type mismatch, expected: pgint8, actual: pgint4

if write explicit cast works fine

local=> CREATE TABLE alert_configuration (
id integer NOT NULL,
alertmanager_configuration text NOT NULL,
configuration_version character varying(3) NOT NULL,
created_at integer NOT NULL,
"default" boolean DEFAULT false NOT NULL,
org_id bigint DEFAULT CAST(0 AS int8) NOT NULL,
configuration_hash character varying(32) DEFAULT 'not-yet-calculated'::character varying NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE

@dcherednik
Copy link
Member Author

"Default expr Value2 type mismatch, expected: Int64, actual: Int32"

in case of " Int64 NOT NULL DEFAULT 1" during table creation

@gridnevvvit
Copy link
Member

fixed in #4085 and in #4046

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants