postgresql - symfony 不喜欢带有 :build-schema Doctrine 的 PostgreSQL

标签 postgresql symfony1 doctrine

当我用我的 PostgreSQL 数据库运行 doctrine:build-schema 时,我遇到了一件奇怪的事情。当然,它应该可以正常工作,但我却得到了这个:

jason@ve:~/salon$ ./symfony doctrine:build-schema
>> doctrine  generating yaml schema from database


  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'                                                                 
  FROM pg_index, pg_attribute a, pg_class c, pg_type t                     
  WHERE c.relname = table_name AND a.attname = column_name                 
  AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid           
  AND c.oid = pg_index.indrelid AND a.attnum = ANY (pg_index.indkey)       
  AND pg_index.indisprimary = 't'                                          
  AND format_type(a.atttypid, a.atttypmod) NOT LIKE 'information_schema%'  
) as pri,                                                                    
character_maximum_length as length                                           
FROM information_schema.COLUMNS                                                
WHERE table_name = 'salon'                                                     
ORDER BY ordinal_position"        

知道为什么会这样吗?

蹩脚的部分是,即使我可以修复 SQL 查询,真正的问题是 symfony/Doctrine 没有按预期工作。 Doctrine 声称支持 PostgreSQL 看起来其他人使用带有 build-schema 的 PostgreSQL 没有问题,所以这很奇怪。

我在使用 symfony 1.4.8 和 Doctrine 1.2。

最佳答案

t.typtype 子句在那里没有任何意义。查询在这方面被打破了。您应该将此报告给作者。

关于postgresql - symfony 不喜欢带有 :build-schema Doctrine 的 PostgreSQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4478986/

相关文章:

jquery - Backbone.js 模型属性返回未定义,但调试显示它在控制台中设置

php - 如何创建一个 Doctrine 实体的模拟对象?

sql - 从表中确定获胜者

python - SQLAlchemy : how can I execute a raw INSERT sql query in a Postgres database?

sql - 如何通过sql查询解决复杂的group?

mysql - Doctrine inversedBy 字段包含 PersistentCollection

collections - Doctrine :如何键入返回实体集合的 setter/getter

SQL查询以查找具有特定数量关联的行

ruby-on-rails - 为什么 Ruby on Rails 没有内置标准的用户认证系统?

mysql - 在 Propel 1.5 中执行多条件连接