Re: naming conventions constraint

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Julian North <julian(at)mulberryst(dot)co(dot)uk>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: naming conventions constraint
Date: 2003-10-24 18:01:24
Message-ID: 1067018483.81651.58.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

rbt=# create table bob_is(your_uncle integer, constraint
"bob_is#your_uncle" check(true));
CREATE TABLE
rbt=# \d bob_is
Table "public.bob_is"
Column | Type | Modifiers
------------+---------+-----------
your_uncle | integer |
Check constraints:
"bob_is#your_uncle" CHECK true

You need to quote strings which contain special characters.

On Thu, 2003-10-23 at 16:30, Julian North wrote:
> I'm at the very beginning of working with postgres.
>
> The aim is to replace / build a number of very large and very complex
> database currently residing in Oracle, MSSQL and Informix.
>
> In order to coordinate across a medium size DBA team I instituted a standard
> constraint naming convention suitable for the above 3 platforms.
>
> For example a foreign key would be FK_table#reftable#column.
>
> Unfortunately I don't appear to be able to use it with postgres.
>
> This is because I can't use the # character in constraint names.
>
> Does anybody have any suggestions as to an alternative that is also a single
> char? (I'm limited to 30 chars cos of oracle and manyof the current names at
> the limit).
>
> Any help appreciated,
>
>
>
> Julian.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Manuel Sugawara 2003-10-24 18:16:54 Re: Regular expression problem
Previous Message scott.marlowe 2003-10-24 17:44:26 Re: Regular expression problem