Re: [help] Error in database import

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Tu Ho <h(dot)diamond084(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: [help] Error in database import
Date: 2024-04-20 04:27:41
Message-ID: 66413cff-e249-4e09-85e7-54374116c035@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/19/24 20:58, Tu Ho wrote:
> Hi,
>
> I am currently having a project where I need to combine 2 large
> database. I was not however able to import an excel file .csv into the

There are Excel files(.xls/.xlsx) and there are *.csv files.

> database. The error was ERROR: syntax error at or near "OIDS" LINE 1:
> ...ing Site" , "International Name(s)" ) FROM STDIN OIDS DELI...
> ^"
>
> I have no idea how to fix this because I used the "upload file"
> option. What should I do?

Use a recent version of whatever client you are using as:

https://www.postgresql.org/docs/current/sql-copy.html

"If 1, OIDs are included in the data; if 0, not. Oid system columns are
not supported in PostgreSQL anymore, but the format still contains the
indicator."

Your client is using old syntax as the last version of Postgres that
allowed FROM STDIN OIDS was:

https://www.postgresql.org/docs/11/sql-copy.html

"where option can be one of:

FORMAT format_name
OIDS [ boolean ]
"

And Postgres 11 is ~6 months past EOL.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message kaido vaikla 2024-04-20 07:59:02 Re: Performance degradation after upgrading from 9.5 to 14
Previous Message Ron Johnson 2024-04-20 04:09:35 Re: [help] Error in database import