problem with insert for Postgresql, please help.

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

problem with insert for Postgresql, please help.

Post by myleow »

Has anyone encountered this problem before?

I perform an INSERTion and there weren't any complains
of error, so i assume that it has no error. When i
perform a SELECT there were 0 rows in the table.

This is just a simple table with (Integer,
Varchar(25),Varchar(50),Varchar(50)) type of data.

The error does not occur all the time, it only happens
once in a while.

Would appreciate if anyone can share their experience
and ways of getting around it with me.

Thank you in advance.

Mian
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

Post by myleow »

The problem happened on another table too... Is there situation when we perform pg_close right after the a pg_exec operation causing this issue?

Would recompiling pgsql help on this situation? Seems to be a pgsql problem because it happened both from PHP and psql console.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Very hard to tell what the issue is with the information provided.

It is unlikely to be a pgsql problem, more likely to be a coding issue.

After the insert try a [pg_man]pg_affected_rows[/pg_man] to check if a row was really inserted.

Is your SELECT correct ?

Could we potentially see some of the code?
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

Post by myleow »

I solved the problem. Its because the page that i was viewing the data from has a delete button to delete the row. When i refresh the page to look at the data again i didn't know the delete was sent again so making it look like the data is not being stored.

My mistake.
Post Reply