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

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "postgresdba111(at)outlook(dot)com" <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 08:35:02
Message-ID: CABUevExLdiN81fEJkD_U4zn81uQiM2wjY_pK9_hR=S6MvT9dkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Aug 21, 2020 at 10:33 AM postgresdba111(at)outlook(dot)com <
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"
>

This is not valid syntax in PostgreSQL (or I believe, in SQL in general).
This is Oracle syntax.

PostgreSQL does not have the number data type, so you'll eventually get a
problem there as well. Which data type to use instead depends on what data
you are actually going to store.

PostgreSQL does not have the varchar2 data type (so you will have to use
varchar).

And finally, varchar just takes a number, not the special construct with
BYTE. PostgreSQL varchar:s always limit the size based on number of
characters, not bytes.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-08-21 09:42:55 Re: Loading Oracle Spatial Data to Postgresql
Previous Message postgresdba111@outlook.com 2020-08-21 08:19:15 > ERROR: syntax error at or near "BYTE"