Re: sequence... my nightmare :-(

From: Martin Gainty <mgainty(at)hotmail(dot)com>
To: Alain Roger <raf(dot)news(at)gmail(dot)com>, <glynastill(at)yahoo(dot)co(dot)uk>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: sequence... my nightmare :-(
Date: 2008-09-27 16:44:46
Message-ID: BLU142-W356806393EB72D41724323AE460@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


you'll need to reference the column with the correct camel_case as
accounts_ID_seq != accounts_id_seq

hint: next time you create a table keep the table and column names lowercase
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.

Date: Sat, 27 Sep 2008 18:21:26 +0200
From: raf(dot)news(at)gmail(dot)com
To: glynastill(at)yahoo(dot)co(dot)uk
Subject: Re: [GENERAL] sequence... my nightmare :-(
CC: pgsql-general(at)postgresql(dot)org

if i double-quote it, postgre tells me that the column accounts_id_seq does not exist.

On Sat, Sep 27, 2008 at 5:59 PM, Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk> wrote:

>

> when i write the following query i get the error :ERROR:

> relation

> "accounts_id_seq" does not exist

> SET search_path = test_survey;

> insert into accounts values

> (nextval('accounts_ID_seq'),'test(at)test(dot)com','ab4ef51934f2d3f02f1a','11/19/2007

> 15:46:09');

>

> why ?

>

It's lowercasing the relation name, note "accounts_id_seq" not "accounts_ID_seq". Try double quoting it.

--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-09-27 16:54:15 Re: sequence... my nightmare :-(
Previous Message Douglas McNaught 2008-09-27 16:37:31 Re: PostgreSQL future ideas