Thread: [NOVICE] Error Relation xxxx does not exist when trying to insert new row

[NOVICE] Error Relation xxxx does not exist when trying to insert new row

From
William Colls
Date:

Environment: Kubuntu 16.04 64 bit: Postgresql 9.5.6 installed from repository.

When I try to insert a new row into a table, I am getting the error relation "xxxx" does not exist. However:

  • in psql the command \d shows "xxxx" to be in the public schema of the current database, and owned by the current user.
  • SHOW search_path returns "$user", public
  • The table, and its columns, were created using pgadmin3. A small test table created from within psql works just fine; no error on insert.
  • The properties of the two tables appear to be the same, when viewed in pgadmin3

What am I missing?

I know this is pretty basic, and I should be able to figure it out for myself, but for now it has me beat.

Thanks for your time.

William.


Re: [NOVICE] Error Relation xxxx does not exist when trying to insert new row

From
Andreas Kretschmer
Date:

Am 31. Mai 2017 04:54:20 MESZ schrieb William Colls <william@williamcollsassoc.ca>:
>Environment: Kubuntu 16.04 64 bit: Postgresql 9.5.6 installed from
>repository.
>
>When I try to insert a new row into a table, I am getting the error
>relation "xxxx" does not exist.
>
>However:
>
>  * in psql the command \d shows "xxxx" to be in the public schema of
>    the current database, and owned by the current user.
>  * SHOW search_path returns "$user", public
>  * The table, and its columns, were created using pgadmin3. A small
>test table created from within psql works just fine; no error on
>insert.
>  * The properties of the two tables appear to be the same, when viewed
>    in pgadmin3
>
>What am I missing?
>
>I know this is pretty basic, and I should be able to figure it out for
>myself, but for now it has me beat.
>
>Thanks for your time.
>
>William.

Maybe a problem with lower/uppercase. Please show us \d in psql and the exact errormessage.

--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.



On 2017-05-31 12:03 AM, Andreas Kretschmer wrote:
>
> Am 31. Mai 2017 04:54:20 MESZ schrieb William Colls <william@williamcollsassoc.ca>:
>> Environment: Kubuntu 16.04 64 bit: Postgresql 9.5.6 installed from
>> repository.
>>
>> When I try to insert a new row into a table, I am getting the error
>> relation "xxxx" does not exist.
>>
>> However:
>>
>>   * in psql the command \d shows "xxxx" to be in the public schema of
>>     the current database, and owned by the current user.
>>   * SHOW search_path returns "$user", public
>>   * The table, and its columns, were created using pgadmin3. A small
>> test table created from within psql works just fine; no error on
>> insert.
>>   * The properties of the two tables appear to be the same, when viewed
>>     in pgadmin3
>>
>> What am I missing?
>>
>> I know this is pretty basic, and I should be able to figure it out for
>> myself, but for now it has me beat.
>>
>> Thanks for your time.
>>
>> William.
> Maybe a problem with lower/uppercase. Please show us \d in psql and the exact errormessage.
>
voipms=> \d
             List of relations
  Schema |      Name      | Type  | Owner
--------+----------------+-------+--------
  public | CallDetail     | table | voipms
  public | my_first_table | table | voipms
(2 rows)

voipms=> INSERT INTO CallDetail
(datetime,Description,account,callerid,destination,Duration,rate,total)
VALUES ('2017-03-31 14:51:22','Inbound
DID','157974','Joe6132227566','6135091304','28','0.01000000','0.00500000');
ERROR:  relation "calldetail" does not exist
LINE 1: INSERT INTO CallDetail (datetime,Description,account,calleri...



Il 31/05/2017 15:57, William Colls ha scritto:
>
> voipms=> \d
>             List of relations
>  Schema |      Name      | Type  | Owner
> --------+----------------+-------+--------
>  public | CallDetail     | table | voipms
>  public | my_first_table | table | voipms
> (2 rows)
>
> voipms=> INSERT INTO CallDetail
> (datetime,Description,account,callerid,destination,Duration,rate,total)
> VALUES ('2017-03-31 14:51:22','Inbound
> DID','157974','Joe6132227566','6135091304','28','0.01000000','0.00500000');
> ERROR:  relation "calldetail" does not exist
> LINE 1: INSERT INTO CallDetail (datetime,Description,account,calleri...
>
>
>
Try changing
INSERT INTO CallDetail
(datetime,Description,account,callerid,destination,Duration,rate,total)
VALUES ('2017-03-31 14:51:22','Inbound
DID','157974','Joe6132227566','6135091304','28','0.01000000','0.00500000');
in
INSERT INTO "CallDetail"
(datetime,"Description",account,callerid,destination,"Duration",rate,total)
VALUES ('2017-03-31 14:51:22','Inbound
DID','157974','Joe6132227566','6135091304','28','0.01000000','0.00500000');

generally speaking, in order to avoid this kind of issues, I prefer
using only lowercase names for everything (databases, tables, column
names, etc)

HTH,
Moreno.




On 2017-05-31 10:06 AM, Moreno Andreo wrote:
> Il 31/05/2017 15:57, William Colls ha scritto:
>>
>> voipms=> \d
>>             List of relations
>>  Schema |      Name      | Type  | Owner
>> --------+----------------+-------+--------
>>  public | CallDetail     | table | voipms
>>  public | my_first_table | table | voipms
>> (2 rows)
>>
>> voipms=> INSERT INTO CallDetail
>> (datetime,Description,account,callerid,destination,Duration,rate,total)
>> VALUES ('2017-03-31 14:51:22','Inbound
>> DID','157974','Joe6132227566','6135091304','28','0.01000000','0.00500000');
>> ERROR:  relation "calldetail" does not exist
>> LINE 1: INSERT INTO CallDetail (datetime,Description,account,calleri...
>>
>>
>>
> Try changing
> INSERT INTO CallDetail
> (datetime,Description,account,callerid,destination,Duration,rate,total)
> VALUES ('2017-03-31 14:51:22','Inbound
> DID','157974','Joe6132227566','6135091304','28','0.01000000','0.00500000');
> in
> INSERT INTO "CallDetail"
> (datetime,"Description",account,callerid,destination,"Duration",rate,total)
> VALUES ('2017-03-31 14:51:22','Inbound
> DID','157974','Joe6132227566','6135091304','28','0.01000000','0.00500000');
>
> generally speaking, in order to avoid this kind of issues, I prefer
> using only lowercase names for everything (databases, tables, column
> names, etc)
>
> HTH,
> Moreno.
>
>
>
Thank you. That got it. I knew it had to be something really simple.
Thanks again.