Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The last ctas sql returns 0 tuple. This is wrong.
$ cat catalog.sql
create temp table t1 (tta varchar, ttb varchar);
create temp table t2 (tta varchar, ttb varchar);
insert into t1 values('a', '1');
insert into t1 values('a', '2');
insert into t1 values('tta', '3');
insert into t1 values('ttb', '4');
insert into t2 select pg_attribute.attname,t1.ttb from pg_attribute join t1 on pg_attribute.attname = t1.tta;
$ psql -f catalog.sql -d postgres
CREATE TABLE
CREATE TABLE
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 0
The join result should be as below for a new database.
INSERT 0 4
tta | ttb
----+----
tta | 3
ttb | 4
tta | 3
ttb | 4
(4 rows)
Attachments
Issue Links
- links to