While creating product, at the last step after retrieving for a time, Magento gives following error-:
SQLSTATE[23000]: Integrity constraint violation:
the message means you are doing another insert with the same combination of columns that are part of the IDX_STOCK_PRODUCT, which seams to be defined as UNIQUE. If it is so, it doesn't allow to enter same combination (it seems like it consists of two fields) twice.
If you are inserting records, make sure you are picking brand new record id or that the combination of record id and the other column is unique.
Without detailed table structure and your code, we can hardly guess whats going wrong.