Skip to content

Loading…

DBAL-21: Pgsql: getListTableColumnsSQL: read domains info (patch provided) #1383

Closed
doctrinebot opened this Issue · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user rdehouss:

Hello,

If you use DOMAIN (CREATE DOMAIN) in pgsql, PostgreSqlPlatform generate a "new \Doctrine\DBAL\DBALException("Unknown database type ".$dbType." requested, " . getclass($this) . " may not support it.");" exception because it does not know the type "domain_name" (CREATE DOMAIN domainname AS VARCHAR(80); )

With this patch, it checks if the given type (either normal type, either domain) is a domain, and if yes, takes the right info (domainname is type varchar and completetype character varying(80)). If it's not a domain, it takes the normal type.

(patch -p0 doctrine2/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php < pgsql_domains.patch)

Also, it's not the goal here, but the queries could be optimized using joins in place of auto join + where, but, as said, the speed is not the goal since the queries are there only for entities mapping.

Hope it helps.

Best regards,

Raphaël Dehousse

@doctrinebot

Comment created by @beberlei:

Let me understand this, this patch automatically detects the underlying type of a new DOMAIN Type created in postgresql?

So say i create a MONEY type and have it be a decimal or something, your code would make doctrine automatically detect it being a decimal and create the decimal doctrine type?

@doctrinebot

Comment created by rdehouss:

Indeed, it will detect the "natural" type under MONEY and use this type for doctrine.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0.0-BETA3 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.