On Tue, 2 Mar 2004, Robert Treat wrote:
> Wouldn't a FK on both tables be the appropriate schema? With the FK on
> contract being deffered?
Unfortunately, it appears that an FK must reference a unique column. So this:
ALTER TABLE contract ADD CONSTRAINT contract_must_have_a_plan
FOR
On Tue, Mar 02, 2004 at 09:45:03 -0500,
Robert Treat <[EMAIL PROTECTED]> wrote:
>
> Wouldn't a FK on both tables be the appropriate schema? With the FK on
> contract being deffered?
No, since he only cares that there is at least one plan for a contract,
not a particular plan. You can do somet
On Monday 01 March 2004 22:59, Curt Sampson wrote:
> On Mon, 1 Mar 2004, Tom Lane wrote:
> > Curt Sampson <[EMAIL PROTECTED]> writes:
> > > Can you explain how to do this? There is no reference to a plan in the
> > > contract table; the constraint just checks to see that, if a contract
> > > exists
On Mon, 1 Mar 2004, Tom Lane wrote:
> Curt Sampson <[EMAIL PROTECTED]> writes:
> > Can you explain how to do this? There is no reference to a plan in the
> > contract table; the constraint just checks to see that, if a contract
> > exists, there is at least one plan referencing that contract.
> >
Curt Sampson <[EMAIL PROTECTED]> writes:
> Can you explain how to do this? There is no reference to a plan in the
> contract table; the constraint just checks to see that, if a contract
> exists, there is at least one plan referencing that contract.
> There is of course a foreign key constraint use
On Thu, 26 Feb 2004, Tom Lane wrote:
> Jonathan Scott <[EMAIL PROTECTED]> writes:
> > The functions and tables create just fine, but when it gets to the
> > COPY part of the sql script, it tries to load tables in what really is
> > the wrong order. The check constraint is making sure there is a "p
Tom,
I have another instance of a possible function being used as a check constraint: a
function that makes sure there is one row, and only one row in a table.
At table creation, and the creation of the constraint, there are no rows in the table.
So, even if the constraint is a valid one to ha
Jonathan Scott <[EMAIL PROTECTED]> writes:
> The functions and tables create just fine, but when it gets to the
> COPY part of the sql script, it tries to load tables in what really is
> the wrong order. The check constraint is making sure there is a "plan"
> before there is a "contract", yet pg_du
Hello again,
A project I am working on has been having problems with pg_dump's output, using 7.3.
Our project's database includes functions that do constraint checking for us, as well
as circular dependencies.
We heard about the changes on the pgsql HEAD/7.5, and have given it a try. It fixed