Re: > ERROR: syntax error at or near "BYTE" - Mailing list pgsql-general

From Paul Förster
Subject Re: > ERROR: syntax error at or near "BYTE"
Date
Msg-id D01ED779-109C-47A5-9A85-01F62CA5914F@gmail.com
Whole thread Raw
In response to > ERROR: syntax error at or near "BYTE"  ("postgresdba111@outlook.com" <postgresdba111@outlook.com>)
List 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 by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Loading Oracle Spatial Data to Postgresql
Next
From: Олег Самойлов
Date:
Subject: is date_part immutable or not?