budirs86 / doophp

Automatically exported from code.google.com/p/doophp
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

DooSqlMagic PgSQL "lastInsertId" method Error #93

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use 'pgsql' and invoke 'insert()' method of the Model

What is the expected output? What do you see instead?
I see the error - 'SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "id" 
does not exist'

What version of the product are you using? On what operating system?
DooPHP 1.5, PHP 5.5.6, nginx 1.5.7, PostgreSQL 9.3 

Please provide any additional information below.

Error resolved by changing argument.
File 'DooSqlMagic.php' line 2082 
from:
return $this->pdo->lastInsertId($model->_primarykey);
to:
return $this->pdo->lastInsertId($model->_table.'_'.$model->_primarykey.'_seq');

The sequence name must be like 'table_column_seq'.

Original issue reported on code.google.com by evgeney....@gmail.com on 8 Jan 2014 at 1:41

GoogleCodeExporter commented 8 years ago
See if sending your request to https://groups.google.com/forum/#!forum/doophp 
will be more fruitful.

Original comment by roman...@gmail.com on 4 May 2014 at 6:27