Is it possible to get the PostgreSQL data domain type in PHP?

6 days ago 9
ARTICLE AD BOX

I have a table in PostgreSQL which uses a custom data domain type:

drop table if exists test; drop domain if exists emoji; create domain emoji as char(2); create table test( data emoji, etc char(2) ); insert into test(data, etc) values('?', '!');

Using PHP & PDO, I connect to the database and fetch from the table:

$dsn = 'pgsql:host=…; dbname=…'; $user = '…'; $password = '…'; $pdo = new PDO($dsn, $user, $password) or die('oops'); $sql = 'SELECT data, etc FROM test'; $pds = $pdo -> query($sql);

Everything is fine so far. Using the getColumMeta() method, I can get some information about the columns. However, there is no difference between the output for each column.

Now, I know that a domain is basically an alias with optional constraints. Is there any way of discovering the domain in PHP?

Read Entire Article