> --- Richard Broersma Jr <[EMAIL PROTECTED]> wrote:
>
>> CREATE UNIQUE INDEX Only_one_row_true
>> ON Your_table ( featured )
>>WHERE featured = true;
>>
>> Or if you want to only allow 1 featured article per catagory then:
>>
>> CREATE UNIQUE INDEX Only_one_row_true_per_catag
OOPS!
--- Richard Broersma Jr <[EMAIL PROTECTED]> wrote:
> CREATE UNIQUE INDEX Only_one_row_true
> ON Your_table ( featured )
>WHERE featured = true;
>
> Or if you want to only allow 1 featured article per catagory then:
>
> CREATE UNIQUE INDEX Only_one_row_true_per_catagory
>
--- PostgreSQL Admin <[EMAIL PROTECTED]> wrote:
> I have a question that I've thought in my head about using triggers, but
> I figure to ask people that do SQL more than I. So, I have a table that
> I want two columns.
>
> (1) A featured column which is for only 1 row, once it switched to
> anoth
I have a question that I've thought in my head about using triggers, but
I figure to ask people that do SQL more than I. So, I have a table that
I want two columns.
(1) A featured column which is for only 1 row, once it switched to
another row than all other rows must be false
title
> I was looking for a solution on how to write a constraint into a ' create
> table ' expression that would ensure that one ' TIME ' attribute value
> called arrival_time (declared as TIME) is allways constrained to have a
> value that ensures it is allways after another attribute value called
> d
Maher, Christopher W writes:
> I was looking for a solution on how to write a constraint into a ' create
> table ' expression that would ensure that one ' TIME ' attribute value
> called arrival_time (declared as TIME) is allways constrained to have a
> value that ensures it is allways after anot
Chris,
> Hi,
> I was looking for a solution on how to write a constraint into a '
> create
> table ' expression that would ensure that one ' TIME ' attribute
> value
> called arrival_time (declared as TIME) is allways constrained to have
> a
> value that ensures it is allways after another attrib
Hi,
I was looking for a solution on how to write a constraint into a ' create
table ' expression that would ensure that one ' TIME ' attribute value
called arrival_time (declared as TIME) is allways constrained to have a
value that ensures it is allways after another attribute value called
departu
Hello folks,
wondering how to display any constraints that a table may have,
as well i know alter table add constraint works, but what's the
syntax to remove one ?
i assume /alter table remove constraint, but i can't find any examples.
jeff
---(end of broadcast)--
Yes. It depends on what exactly you want for the update/delete cases
on permissions. I believe that in any cases you can use the
check function that's used by the fk implementation to do the
insert/update check on objects. If you don't mind update/deletes
on permission failing if the row being
Does anyone know how I can make a constraint on a key to enforce a 1
to n relationship where n>0?
I've invented an example to show the sort of constraint I need:
CREATE TABLE permissions (
id int4,
userid int4,
perm int4,
primary key (id,userid)
);
CREATE TABLE objects (
id int4,
per
11 matches
Mail list logo