0

Is it possible to get the same name attributes in the select list (as JSON deduplicates them)?
For instance:

CREATE TABLE t1 (
  id int;
);
INSERT INTO t1 VALUES(1);
INSERT INTO t1 VALUES(2);
CREATE TABLE t2 (
  id int;
);
INSERT INTO t2 VALUES(1);

SELECT *
  FROM t1 LEFT JOIN t2 ON t1.id = t2.id

should return:

id id 
-----
1   1
2   null


but will return instead:

id
---
1
null

I'm trying to build a web-based SQL editor, and this is kind of a showstopper.

igorludi
  • 1,519
  • 2
  • 18
  • 31

1 Answers1

1

Sorry, found it, it was solved in:

One can use rowMode argument to get results as an array:
http://vitaly-t.github.io/pg-promise/PreparedStatement.html#rowMode

igorludi
  • 1,519
  • 2
  • 18
  • 31