I am using pgsql with php. When trying to echo data in tables using row['field name'] , it is returning error. I am currently using row['row_number'] which is really inconvenient.
If it is an issue, then it is a PHP API issue. This is a PostgreSQL bug list.
You wrote nothing about the API that you use. Probably it is an older PG driver. a PDO driver works differently.
But I don't think so this is a bug. Building an int indexed array is faster than building a string indexed array. This API is pretty old, and had strong benefits on slower computers.
If you want different access, then you can you different API