Обсуждение: insert statement going into infinite loop

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

insert statement going into infinite loop

От
Trimurthulu Bandaru
Дата:
Hi everybody..
I have table with 11 attributes, 6 of them refers different tables and
having one primary key.
when I am trying to insert row with 121 key value, its going into
infinite loop..
I didnt find any error in table definition and no foreign key
violations..
Can you please help me in this issue..
I am thinking its a bug in postgres..
Can you make clear in this issue..

thank you..


--
with best
 --Trim..

Re: insert statement going into infinite loop

От
Jaime Casanova
Дата:
On Fri, Dec 24, 2010 at 6:57 AM, Trimurthulu Bandaru
<trimurthulub@mediaforte.in> wrote:
> Hi everybody..
> I have table with 11 attributes, 6 of them refers different tables and
> having one primary key.
> when I am trying to insert row with 121 key value, its going into
> infinite loop..

define "infinite loop", the truth is that you're giving almost no
information so all we can try now is to guess and cross fingers ;)

are you describing that the INSERT never finishes?
if so, maybe the table is locked... you can know that by looking in
pg_stat_activity view and find your statement in the field
current_query and see the field waiting, if is true then the statement
is locked waiting for something...
or you can see the pg_locks view where relation =3D 'your_table'::regclass

another posibility is that you have a trigger in the table after or
before insert and then inside the trigger inserting a new value on the
same table forcing a new execution of the trigger making it
recursive...

> I am thinking its a bug in postgres..

it's too early to blame postgres

--=20
Jaime Casanova=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitaci=C3=B3n de PostgreSQL

Re: insert statement going into infinite loop

От
Craig Ringer
Дата:
On 12/24/2010 10:57 PM, Trimurthulu Bandaru wrote:
> Hi everybody..
> I have table with 11 attributes, 6 of them refers different tables and
> having one primary key.
> when I am trying to insert row with 121 key value, its going into
> infinite loop..

Do you have any triggers on the table?

Can you produce a single .sql file that creates the tables and does the
problem insert?

--
Craig Ringer

Re: insert statement going into infinite loop

От
Trimurthulu Bandaru
Дата:
On Sat, 2010-12-25 at 11:56 +1100, Craig Ringer wrote:
> On 12/24/2010 10:57 PM, Trimurthulu Bandaru wrote:
> > Hi everybody..
> > I have table with 11 attributes, 6 of them refers different tables and
> > having one primary key.
> > when I am trying to insert row with 121 key value, its going into
> > infinite loop..
>
> Do you have any triggers on the table?
>
> Can you produce a single .sql file that creates the tables and does the
> problem insert?
>
> --
> Craig Ringer

Hi Craig Ringer
Thanks for reply..
No. I dont have any triggres on the table.
and I could not understand your idea

Can you produce a single .sql file that creates the tables and does the
problem insert?

Can you please make me clear in this issue..


--
with best
 --Trim..

Re: insert statement going into infinite loop

От
John R Pierce
Дата:
On 12/27/10 10:31 PM, Trimurthulu Bandaru wrote:
>
> Can you produce a single .sql file that creates the tables and does the
> problem insert?
>
> Can you please make me clear in this issue..

he's asking if you can produce a test case in the form of a .SQL file
that creates a schema and demonstrates this problem so the development
team can verify if there is/isn't a problem, and fix it if there is.