Add a table check constraint

View: New views
3 Messages — Rating Filter:   Alert me  

Add a table check constraint

by Alejandro Weinstein-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi:

I want to add a table check constraint, to a postgres database. For
instance:

CREATE TABLE table_a (
     column_1 integer,
     column_2 integer
     CHECK (column_1 > column_2)
);

 From the documentation, I understand that I have to use an UML
SmallPackages, with an stereotype like

postgres:table(table_a)

My problem is that I don't know where to place the "CHECK (column_1 >
column_2)" part, since I see only the stereotype field in the
SmallPackage, and nothing else.

Is the SmallPackage the right object to use? If yes, where do I place
the text of the constraint?

Regards,
Alejandro Weinstein.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Add a table check constraint

by Matt O'Donohue :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Alejandro Weinstein wrote:

> Hi:
>
> I want to add a table check constraint, to a postgres database. For
> instance:
>
> CREATE TABLE table_a (
>     column_1 integer,
>     column_2 integer
>     CHECK (column_1 > column_2)
> );
>
>  From the documentation, I understand that I have to use an UML
> SmallPackages, with an stereotype like
>
> postgres:table(table_a)
>
> My problem is that I don't know where to place the "CHECK (column_1 >
> column_2)" part, since I see only the stereotype field in the
> SmallPackage, and nothing else.
>
> Is the SmallPackage the right object to use? If yes, where do I place
> the text of the constraint?
>
> Regards,
> Alejandro Weinstein.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Add a table check constraint

by Mike Ginou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alejandro,

Just type directly in the Small Package itself, you don't need the
property window open. Just click somewhere in the box and you should be
able to type.

Hope that helps!

Cheers,
Mike

Alejandro Weinstein wrote:

> Hi:
>
> I want to add a table check constraint, to a postgres database. For
> instance:
>
> CREATE TABLE table_a (
>     column_1 integer,
>     column_2 integer
>     CHECK (column_1 > column_2)
> );
>
> From the documentation, I understand that I have to use an UML
> SmallPackages, with an stereotype like
>
> postgres:table(table_a)
>
> My problem is that I don't know where to place the "CHECK (column_1 >
> column_2)" part, since I see only the stereotype field in the
> SmallPackage, and nothing else.
>
> Is the SmallPackage the right object to use? If yes, where do I place
> the text of the constraint?
>
> Regards,
> Alejandro Weinstein.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price