RI violation msg suggestion

Поиск
Список
Период
Сортировка
Искать

RI violation msg suggestion

От:
Ed Loehr <eloehr@austin.rr.com>
Дата:
Minor usability/debuggability suggestion...

RI violation error messages in 7.0.0 do not appear to identify the
offending value.

Example:

ERROR:  fk_employee_currency referential integrity violation - key
referenced from employee not found in currency

Easier to debug would be:

ERROR:  fk_employee_currency referential integrity violation - key '27'
referenced from employee not found in currency

Regards,
Ed Loehr

copy from stdin limits

От:
Camm Maguire <camm@enhanced.com>
Дата:
Greetings!  'copy from stdin' on 7.0.2 appears to simply hang if more
than ~ 1000 records follow in one shot.  I couldn't see this behavior
documented anywhere.  Is this a bug?

Take care,
-- 
Camm Maguire			     			camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

Re: copy from stdin limits

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Camm Maguire  writes:
> Greetings!  'copy from stdin' on 7.0.2 appears to simply hang if more
> than ~ 1000 records follow in one shot.  I couldn't see this behavior
> documented anywhere.  Is this a bug?

I've never heard of any such behavior ... and you can be sure that we'd
have heard about this, since any moderately large pg_dump file would
trigger such a bug.  You must have something else going on.  Details
please?
		regards, tom lane

Re: copy from stdin limits

От:
Camm Maguire <camm@enhanced.com>
Дата:
Greetings, and thank you for your reply.

OK, I have 4 tables, and a view on a merge of the 4.  I have a trigger
on insert into table 3, and a trigger on insert into the view, which
basically just takes the input data, does a few selects on the tables,
and inserts the appropriate portions of the data into each table as
necessary.  

When I copy up to ~ 1000 lines of a file into this view, everything
goes fine.  More than that, and after a while, cpu activity stops,
disk activity stops, and the job hangs indefinitely.  Control-C gives
the later message "You have to get out of copy state yourself".  I can
provide the schema if needed.

Thanks for your help!


Tom Lane  writes:

> Camm Maguire  writes:
> > Greetings!  'copy from stdin' on 7.0.2 appears to simply hang if more
> > than ~ 1000 records follow in one shot.  I couldn't see this behavior
> > documented anywhere.  Is this a bug?
> 
> I've never heard of any such behavior ... and you can be sure that we'd
> have heard about this, since any moderately large pg_dump file would
> trigger such a bug.  You must have something else going on.  Details
> please?
> 
> 			regards, tom lane
> 
> 

-- 
Camm Maguire			     			camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

Re: copy from stdin limits

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Camm Maguire  writes:
> OK, I have 4 tables, and a view on a merge of the 4.  I have a trigger
> on insert into table 3, and a trigger on insert into the view, which
> basically just takes the input data, does a few selects on the tables,
> and inserts the appropriate portions of the data into each table as
> necessary.  

> When I copy up to ~ 1000 lines of a file into this view, everything
> goes fine.

I'm a bit startled that COPY to a view works at all ;-).  But it does
look like copy honors triggers, so in principle the above ought to work.

I'll need to see the complete details of the trigger and all the
referenced table declarations --- probably don't need the data, though,
unless the trigger needs to have nonempty tables to start with.
		regards, tom lane

FAQ