Re: > ERROR: syntax error at or near "BYTE"

Поиск
Список
Период
Сортировка
От Paul Förster
Тема Re: > ERROR: syntax error at or near "BYTE"
Дата
Msg-id D01ED779-109C-47A5-9A85-01F62CA5914F@gmail.com
обсуждение исходный текст
Ответ на > ERROR: syntax error at or near "BYTE"  ("postgresdba111@outlook.com" <postgresdba111@outlook.com>)
Список pgsql-general
Hi,

> On 21. Aug, 2020, at 10:19, postgresdba111@outlook.com wrote:
>
> CREATE TABLE "A"
> (
>   "b"                 DATE,
>   "c  "               NUMBER,
>  " d "                  VARCHAR2(255 BYTE),
>   "e "            VARCHAR2(255 BYTE))
>
>   When ı create table then after error why error in byte please heplp me thanks
>
>   error:> ERROR:  syntax error at or near "BYTE"

several problems:

a) don't put blanks in your names, neither table names nor attributes.
b) PostgreSQL doesn't have NUMBER. Use integer instead.
c) PostgreSQL doesn't have VARCHAR2. User text instead.

So, the correct statement would be:

create table a (
    b date,
    c integer,
    d text,
    e text
);

Hope this helps.

Cheers,
Paul


В списке pgsql-general по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Loading Oracle Spatial Data to Postgresql
Следующее
От: Олег Самойлов
Дата:
Сообщение: is date_part immutable or not?