top-think / top-think/think-orm
pgsql.sql在新版本(pg版本大于10)报pg_attrdef.adsrc不存在的解决办法
Open
Nobody has claimed this yet.
PostgreSQL
- Dominant language
- PHP
- Stars
- 437
- Forks
- 188
- PR merge metrics
- No merged PRs in 30d
Description
原因
pg_attrdef.adsrc在pg版本大于10后已经被取消了,这个字段不存在了。
解决办法
将pgsql.sql的61行:
pg_attrdef.adsrc AS fields_default,
更换为:
pg_get_expr(pg_attrdef.adbin, pg_attrdef.adrelid) AS fields_default,
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open pgsql.sql and inspect line 61, where the PostgreSQL column default is read. Check the compatibility difference between PostgreSQL versions before and after 10, then verify the query works on a PostgreSQL version above 10. Done means the ORM can read column defaults without referencing the removed field.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100