This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- first we have an array which only has elements 2, 3 and 4 with value of 1 | |
=> select array_fill(1, ARRAY[3], ARRAY[2]); | |
array_fill | |
--------------- | |
[2:4]={1,1,1} | |
(1 row) | |
-- if we use generate_subscripts() to unnest the array all is well | |
=> select generate_subscripts(a, 1) as idx, unnest(a) as a from (select array_fill(1, ARRAY[3], ARRAY[2]) as a) x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// go get github.com/tgres/tgres | |
// go run simpletgres.go | |
package main | |
import ( | |
"fmt" | |
"math" | |
"net/http" | |
"time" |