pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Relation "autonummeringl2" does not exist
3+ messages / 3 participants
[nested] [flat]

* Relation "autonummeringl2" does not exist
@ 2005-01-22 13:03  Nico <haegens_nico@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Nico @ 2005-01-22 13:03 UTC (permalink / raw)
  To: pgsql-jdbc

Hello,
as I have told, I am making a servlet that generates a menu and one that 
changes it(deleting, adding & updating items). However it returns an error:
Relation "autonummeringl2" does not exist
autonummeringL2 is the name of a sequence that raises a field by 1 each time 
it is called. Any suggestions are welcome.

Nico.

Here is the table creation sql:
 CREATE TABLE "tblMenuL2" (
    "MenuL2ID" integer DEFAULT nextval('autonummeringL2'::text) NOT NULL,
    "MenuL1ID" integer NOT NULL,
    "MenuL2Name" character varying(50) NOT NULL,
    "MenuL2Page" character varying(50),
    "MenuL2Order" smallint NOT NULL
);
ALTER TABLE ONLY "tblMenuL2"
    ADD CONSTRAINT "pkMenuL2ID" PRIMARY KEY ("MenuL2ID");
ALTER TABLE ONLY "tblMenuL2"
    ADD CONSTRAINT "fkMenuL1ID" FOREIGN KEY ("MenuL1ID") REFERENCES 
"tblMenuL1"("MenuL1ID") ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY "tblMenuL2"
    ADD CONSTRAINT "MenuL2Volgorde" UNIQUE ("MenuL2ID", "MenuL1ID");

Here is the update query & insert. It happens during the insert query.:
UPDATE "tblMenuL2" SET "MenuL2Order"="MenuL2Order"+1 WHERE "MenuL2Order">=5; 
INSERT INTO "tblMenuL2"("MenuL1ID", "MenuL2Name", "MenuL2Page", 
"MenuL2Order") VALUES(1, 'naam', 'pagina', 5); 





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Relation "autonummeringl2" does not exist
@ 2005-01-22 19:05  Dave Cramer <pg@fastcrypt.com>
  parent: Nico <haegens_nico@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Dave Cramer @ 2005-01-22 19:05 UTC (permalink / raw)
  To: Nico <haegens_nico@yahoo.com>; +Cc: pgsql-jdbc

You should avoid upper case column names, 'autonumberingL2' is different 
than "autonumberingL2"

note the double quotes vs single quotes.

Dave

Nico wrote:

>Hello,
>as I have told, I am making a servlet that generates a menu and one that 
>changes it(deleting, adding & updating items). However it returns an error:
>Relation "autonummeringl2" does not exist
>autonummeringL2 is the name of a sequence that raises a field by 1 each time 
>it is called. Any suggestions are welcome.
>
>Nico.
>
>Here is the table creation sql:
> CREATE TABLE "tblMenuL2" (
>    "MenuL2ID" integer DEFAULT nextval('autonummeringL2'::text) NOT NULL,
>    "MenuL1ID" integer NOT NULL,
>    "MenuL2Name" character varying(50) NOT NULL,
>    "MenuL2Page" character varying(50),
>    "MenuL2Order" smallint NOT NULL
>);
>ALTER TABLE ONLY "tblMenuL2"
>    ADD CONSTRAINT "pkMenuL2ID" PRIMARY KEY ("MenuL2ID");
>ALTER TABLE ONLY "tblMenuL2"
>    ADD CONSTRAINT "fkMenuL1ID" FOREIGN KEY ("MenuL1ID") REFERENCES 
>"tblMenuL1"("MenuL1ID") ON UPDATE CASCADE ON DELETE CASCADE;
>ALTER TABLE ONLY "tblMenuL2"
>    ADD CONSTRAINT "MenuL2Volgorde" UNIQUE ("MenuL2ID", "MenuL1ID");
>
>Here is the update query & insert. It happens during the insert query.:
>UPDATE "tblMenuL2" SET "MenuL2Order"="MenuL2Order"+1 WHERE "MenuL2Order">=5; 
>INSERT INTO "tblMenuL2"("MenuL1ID", "MenuL2Name", "MenuL2Page", 
>"MenuL2Order") VALUES(1, 'naam', 'pagina', 5); 
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>
>  
>

-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Relation "autonummeringl2" does not exist
@ 2005-01-22 19:34  Nico <nicohmail-postgresql@yahoo.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Nico @ 2005-01-22 19:34 UTC (permalink / raw)
  To: pgsql-jdbc

I changed the name of sequences in the database. It works fine now.
Thanks.

"Dave Cramer" <pg@fastcrypt.com> schreef in bericht 
news:41F2A3FB.4000206@fastcrypt.com...
> You should avoid upper case column names, 'autonumberingL2' is different 
> than "autonumberingL2"
>
> note the double quotes vs single quotes.
>
> Dave
>
> Nico wrote:
>
>>Hello,
>>as I have told, I am making a servlet that generates a menu and one that 
>>changes it(deleting, adding & updating items). However it returns an 
>>error:
>>Relation "autonummeringl2" does not exist
>>autonummeringL2 is the name of a sequence that raises a field by 1 each 
>>time it is called. Any suggestions are welcome.
>>
>>Nico.
>>
>>Here is the table creation sql:
>> CREATE TABLE "tblMenuL2" (
>>    "MenuL2ID" integer DEFAULT nextval('autonummeringL2'::text) NOT NULL,
>>    "MenuL1ID" integer NOT NULL,
>>    "MenuL2Name" character varying(50) NOT NULL,
>>    "MenuL2Page" character varying(50),
>>    "MenuL2Order" smallint NOT NULL
>>);
>>ALTER TABLE ONLY "tblMenuL2"
>>    ADD CONSTRAINT "pkMenuL2ID" PRIMARY KEY ("MenuL2ID");
>>ALTER TABLE ONLY "tblMenuL2"
>>    ADD CONSTRAINT "fkMenuL1ID" FOREIGN KEY ("MenuL1ID") REFERENCES 
>> "tblMenuL1"("MenuL1ID") ON UPDATE CASCADE ON DELETE CASCADE;
>>ALTER TABLE ONLY "tblMenuL2"
>>    ADD CONSTRAINT "MenuL2Volgorde" UNIQUE ("MenuL2ID", "MenuL1ID");
>>
>>Here is the update query & insert. It happens during the insert query.:
>>UPDATE "tblMenuL2" SET "MenuL2Order"="MenuL2Order"+1 WHERE 
>>"MenuL2Order">=5; INSERT INTO "tblMenuL2"("MenuL1ID", "MenuL2Name", 
>>"MenuL2Page", "MenuL2Order") VALUES(1, 'naam', 'pagina', 5);
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 4: Don't 'kill -9' the postmaster
>>
>>
>>
>
> -- 
> Dave Cramer
> http://www.postgresintl.com
> 519 939 0336
> ICQ#14675561
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
> 





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-01-22 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-22 13:03 Relation "autonummeringl2" does not exist Nico <haegens_nico@yahoo.com>
2005-01-22 19:05 ` Dave Cramer <pg@fastcrypt.com>
2005-01-22 19:34   ` Nico <nicohmail-postgresql@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox