GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - csimsek/pgsql-fio: PostgreSQL File I/O Functions

BranchesTags
Open more actions menu

Latest commit

 

History

65 Commits
65 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
fio--1.0.sql
fio--1.0.sql
 
 
fio.control
fio.control
 
 

Repository files navigation

PostgreSQL "basic" File I/O Functions

Quick Start

This extension for some basic file system functions.

After checkout the code run that command:

make install

Please note: Do not forget edit Makefile for PG_CONFIG entry.

And then go to psql console and install the extension for your db

$ psql dbname

dbname# CREATE EXTENSION fio;

After creating extension, you can use functions with fio_ prefix.

For example:

dbname=# select fio_readdir('/usr/', '*');
  fio_readdir 
-------------
 (include)
 (src)
 (lib64)
 (.)
 (tmp)
 (pgsql-9.3)
 (bin)
 (..)
 (libexec)
 (local)
 (lib)
 (share)
 (games)
 (pgsql-9.4)
 (etc)
 (java)
 (sbin)
(17 rows)
dbname=# 

Functions

fio_chmod(pathname varchar, mode varchar);
  • pathname: the path's name you want to change mode
  • mode: string for mode (ex: '0777')
fio_mkdir(pathname varchar, mode varchar, recursive boolean default false)
  • pathname: the path's name you want to create
  • mode: string for mode (ex: '0777')
  • recursive: create directory recursion
fio_readdir(pathname varchar, pattern varchar default '*')
  • pathname: the path's name you want to list of files/directories
  • pattern: shell like pattern you want to filter (ex: '*.jpg')
fio_readfile(filename varchar)
  • filename: The file's name you want to read. Return type is bytea.
fio_writefile(filename varchar, content bytea, mkdir boolean default false, overwrite boolean DEFAULT false)
  • filename: The file's name you want to create/write.
  • content: What content you want to write the file.
  • mkdir: If true, it creates directory with given filename. Creates directory with recursion option.
  • overwrite: If true overwrite file if already exists. If false and file exists it fails.
fio_removefile(filename varchar)
  • filename: The file's name you want to remove.
fio_renamefile(filename varchar, newfilename varchar)
  • filename: The file's name you want to rename.
  • newfilename: The new file's name

About

PostgreSQL File I/O Functions

Resources

Readme
BSD-3-Clause license
Activity

Stars

33 stars

Watchers

6 watching

Forks

11 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.