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
CREATE OR REPLACE FUNCTION run_server() RETURNS text | |
LANGUAGE plpythonu STRICT | |
AS $$ | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
class PGHandler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
plpy.notice("Path: %s" % self.path) | |
if self.path.count('/') == 2 and self.path.split('/')[1] != "" and self.path.split('/')[2] != "": | |
nsp = plpy.quote_ident(self.path.split('/')[1]) |
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
#include <stdio.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <string.h> | |
int errnum, fd; | |
int main(int argc, char *argv[]) { | |
if ( argc == 2 ) { | |
fd = open(argv[1], O_CREAT); |