python3 -c "import pg; db=pg.DB('postgres'); q=db.query('SELECT 
array_agg(column_name) AS cols FROM information_schema.columns').getresult(); 
print(q[0][0][0])"
{
python3 -c "import pg; db=pg.DB('postgres'); q=db.query('SELECT 
array_agg(column_name::text) AS cols FROM 
information_schema.columns').getresult(); print(q[0][0][0])"
leader_pid

I think it should treat this as array[text] rather than text.

But I'm certain that it shouldn't cause errors in the logs:

2021-09-08 09:28:57.846-05-ERROR-6138c8a9.7c7f-pryzbyj-postgres--type  
"_sql_identifier" does not exist-SELECT oid, typname, typname::regtype,  
typlen, typtype, typcategory, typdelim, typrelid FROM pg_cat

Maybe it should use to_regtype() on servers with version >= 9.4
https://www.postgresql.org/docs/9.4/functions-info.html

I think maybe the way to see if something is an array is by checking typarray,
not by using the underscore suffix.  That works back to v8.3...

| SELECT a.typname, b.typname, a.typtype, b.typtype FROM pg_type a JOIN pg_type 
b ON a.typarray=b.oid
_______________________________________________
PyGreSQL mailing list
PyGreSQL@Vex.Net
https://mail.vex.net/mailman/listinfo/pygresql

Reply via email to