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

From: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
To: postgresdba111(at)outlook(dot)com
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: > ERROR: syntax error at or near "BYTE"
Date: 2020-08-21 10:17:14
Message-ID: D01ED779-109C-47A5-9A85-01F62CA5914F@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

> On 21. Aug, 2020, at 10:19, postgresdba111(at)outlook(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Олег Самойлов 2020-08-21 11:57:01 is date_part immutable or not?
Previous Message Laurenz Albe 2020-08-21 09:42:55 Re: Loading Oracle Spatial Data to Postgresql