Re: duplicate key violates unique constraint - Mailing list pgsql-sql

From Alvaro Herrera
Subject Re: duplicate key violates unique constraint
Date
Msg-id 20080226170325.GJ5763@alvh.no-ip.org
Whole thread Raw
In response to Re: duplicate key violates unique constraint  ("Shavonne Marietta Wijesinghe" <shavonne.marietta@studioform.it>)
List pgsql-sql
Shavonne Marietta Wijesinghe wrote:
> I wrote the query in the SQL windows provided by the pgadmin.

That SQL window only executes SQL, so you can't use PL/pgSQL commands on
it.  PL/pgSQL can only be used in the context of a PL/pgSQL function, so
you need to do CREATE FUNCTION to do that.

If you want to use the SQL window you could use SAVEPOINT and ROLLBACK TO.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-sql by date:

Previous
From: "Bart Degryse"
Date:
Subject: Re: Function returns error (view)
Next
From: "Rodrigo E. De León Plicet"
Date:
Subject: Re: duplicate key violates unique constraint