Re: Rename a constraint - Mailing list pgsql-general

From Thom Brown
Subject Re: Rename a constraint
Date
Msg-id bddc86150901101122l37a5ad4h63940677cb94b5ca@mail.gmail.com
Whole thread Raw
In response to Re: Rename a constraint  (Raymond O'Donnell <rod@iol.ie>)
List pgsql-general
That would make more sense wouldn't it.  :)  Yeah, I think that's the answer.

Cheers!

Thom

2009/1/10 Raymond O'Donnell <rod@iol.ie>
On 10/01/2009 19:15, Thom Brown wrote:
> I can't find anything in the documentation, but does anyone know if
> there is a way to rename a constraint?

I just tried it with a primary key...

test=# alter table t1 alter constraint t1_pk rename to t1_pp;
ERROR:  syntax error at or near "constraint"
LINE 1: alter constraint t1_pk rename to t1_pp;


... and as you can see it didn't work. I suppose you could always drop
and recreate it with a different name.

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Rename a constraint
Next
From: Bruno Lavoie
Date:
Subject: Renaming tables and columns to lowercase