0

Every time when I create a table in pgadmin 4. Systems columns(tableoid, oid, xmix,xmax, cmin,cmax) are generated by default. When i import a CSV file using pgadmin4 GUI it throws an error since I don't have those columns in CSV file. I have to manually unchoose or uncheck systems columns in columns option before importing.I was not facing this issue before.

Here is the create table command generated when i created using pg admin

CREATE TABLE public."LineChart1"
(
    "Date" date,
    "Price" money
)
WITH (
    OIDS = FALSE
);

ALTER TABLE public."LineChart1"
    OWNER to eerfrusycfampt;

Error Message

ERROR:  column "tableoid" of relation "LineChart1" does not exist

How to prevent system columns generated by default?

Thanks

Ghatwar
  • 1
  • 4
  • 3
    You can't prevent that because those are system columns and required so that Postgres works properly. The `oid` column however should _not_ be created with any recent Postgres version unless you add `with oids` to the `create table` statement. The presence of those columns will **not** generate an error during import. –  Dec 03 '17 at 15:52
  • Please [edit] your question and add the complete `create table` statement for the table in question and the "import" statement you are using. [**Formatted text**](http://stackoverflow.com/help/formatting) please, [no screen shots](http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557) [edit] your question - do **not** post code or additional information in comments. –  Dec 03 '17 at 15:53
  • 1
    Those columns aren't generated. They are service columns. Postgresql COPY command, when copying CSVs, only works with columns explicitly declared in the table. – Alex Dec 03 '17 at 16:19
  • So what is the **exact** statement you use to import the CSV file? –  Dec 04 '17 at 08:28
  • I use pgadmin4 GUI – Ghatwar Dec 04 '17 at 08:43

0 Answers0