'malformed array literal error working with postgreSQL
I am trying to create and populate a table to store some data, but when i try to populate it i receive the error:
ERROR: malformed array literal: "znz"
LINE 30: values ('znz','[email protected]', 01-01-1990,'costanzo'...
^
DETAIL: Array value must start with "{" or dimension information.
SQL state: 22P02
Character: 990
this is my code:
create table Employee (
CF char[3] primary key,
email varchar[100] unique not null,
date_of_birth date not null,
employee_name varchar[20] not null,
employee_surname varchar[20] not null,
sex char check(sex = 'M' or sex ='F' or sex = 'A') default 'A',
city varchar[20] not null,
street varchar[50] not null,
e_number varchar[5] not null,
CAP char[5] default null,
country char (2) not null default 'it',
salary numeric(9,2) not null default 0,
telephone_number varchar[13]);
insert into Employee(CF,email,date_of_birth,employee_name,employee_surname,sex,city,street,e_number,CAP,country,salary,telephone_number)
values ('znz','[email protected]', 01-01-1990,'costanzo','vecchio','M', 'Padova','Roma','2B','35020','IT', 2000, '+398887760093');
this is just the first piece of a bigger project, and i receive the same error everytime i try to insert a value. I'm working with pgAdmin4 version 6.2
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
