Skip to content

Instantly share code, notes, and snippets.

View davidradernj's full-sized avatar

David Rader davidradernj

  • AWS
  • USA, NJ
View GitHub Profile
@davidradernj
davidradernj / py_environ.sql
Created September 9, 2016 16:55
plpython to read environment variable from PostgreSQL
create extension plpythonu;
create type py_environ_type as (name text, value text);
create or replace function py_environ(name varchar DEFAULT NULL)
returns setof py_environ_type
as $$
import os
aev = []
if name is None:
//try to debug weird filesystem size reported in docker container for cockroachdb
package main
import "fmt"
import "strconv"
import "github.com/elastic/gosigar"
import "syscall"
func getReadableFileSize(inbytes int64) string {