Re: Error in Table Creation

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Rajnish Vishwakarma <rajnish(dot)nationfirst(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Error in Table Creation
Date: 2020-06-25 09:04:07
Message-ID: CAECtzeUXNYZkg7mYpw9g-X9dd6CD_MVdVXV=niLDL1PtqX4O3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le jeu. 25 juin 2020 à 10:59, Rajnish Vishwakarma <
rajnish(dot)nationfirst(at)gmail(dot)com> a écrit :

> I am creating dynamically table in PostgreSQL using psycopg2 by passing
> the below 2 strings as column names:
>
>
> 'BAF7_X_X_During_soaking-__Temperature__difference_coil_to_coil_with_metal_temp_TC_load_in_PA_load'
>
> and
>
>
> 'BAF7_X_X_During_soaking-__Temperature__difference_coil_to_coil_with_metal_temp_TC_load__in_TA_load'
>
> And the above column names are not same ( both are different columns ) and
> both the columns has string same till *'BAF7_X_X_During_soaking-__Temperature__difference_coil_to_coil_with_metal_temp_TC_load__
> .*
>
> but i am getting errors as
>
> Error:
> Traceback (most recent call last):
> File "C:/Users/Administrator/PycharmProjects/untitled/table_creation_with_HDA_Data.py", line 131, in <module>
> cursor.execute(sqlCreateTable)
> psycopg2.errors.DuplicateColumn: column "BAF7_X_X_During_soaking-__Temperature__difference_coil_to_coil_" specified more than once
>
> The above columns are of type TEXT ...also it may be Numeric Type in
> future.
>
> Require assistance from Postgres team on the above error.
>

Object names in PostgreSQL are limited to 63 characters. If you put more
characters, it will silently truncate them to 63 characters. In your case,
they are truncated, and the truncated strings end up being the same. So,
use less characters for your objects' names.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2020-06-25 09:05:00 Re: Error in Table Creation
Previous Message Bhalodiya, Chirag 2020-06-25 07:50:29 PostGreSQL TDE encryption patch