Note that there are some explanatory texts on larger screens.

plurals
  1. PODoctrine and Postgresql, Generate Models from DB Problem
    primarykey
    data
    text
    <p>I have a database in Postgresql 9.0 and I'm trying to use Doctrine ORM 1.2 to generate models from db.</p> <p>Here is my code:</p> <pre><code>&lt;?php require_once 'Doctrine.php'; spl_autoload_register(array('Doctrine', 'autoload')); spl_autoload_register(array('Doctrine_Core', 'modelsAutoload')); $manager = Doctrine_Manager::getInstance(); $conn = Doctrine_Manager::connection('pgsql://postgres:secret@192.168.1.108/erp','doctrine'); $conn-&gt;setAttribute( Doctrine_Core::ATTR_PORTABILITY, Doctrine_Core::PORTABILITY_FIX_CASE | PORTABILITY_RTM); $conn-&gt;setAttribute( Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true); $manager-&gt;setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true); Doctrine_Core::loadModels('../application/models'); Doctrine_Core::generateModelsFromDb('../application/models', array('doctrine'), array('generateTableClasses' =&gt; true)); ?&gt; </code></pre> <p>and when I run the page, I get this error:</p> <pre><code>Fatal error: Uncaught exception 'Doctrine_Connection_Pgsql_Exception' with message 'SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry for table "t" LINE 6: ... t.typtype ... ^. Failing Query: "SELECT ordinal_position as attnum, column_name as field, udt_name as type, data_type as complete_type, t.typtype AS typtype, is_nullable as isnotnull, column_default as default, ( SELECT 't' in D:\Doctrine-1.2.3\Doctrine-1.2.3\Doctrine\Connection.php on line 1082 </code></pre> <p>It's worth to mention, this code is working perfectly for mysql (by having mysql:// ... in the connection ofcurse), but having trouble to get it working with postgresql 9.0.</p> <p>Any idea?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload