Storing Media Types

From: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Storing Media Types
Date: 2011-02-10 00:29:40
Message-ID: AANLkTikh2+5mBHSeD+Ztt1DHExbfuTKhXtEnS7v-FXyk@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've created a basic table called 'employees' & I've been asked to
store a profile photo of all employees. I've looked on Google and the
9.0 documentation but can't find any clear instructions on how I would
be to insert photo's stored in a local directory on the server
(/var/lib/postgres/data/media/pics). I'm trying to understand how I
would create an entry into the table I show below to be able to add
photo's for each user. Does anyone have an example of what the code
would look like and or offer any assistance?

ghost=> CREATE TABLE employees
(
id INT PRIMARY KEY NOT NULL UNIQUE,
fname VARCHAR(50) NOT NULL,
lname VARCHAR(50) NOT NULL,
email VARCHAR(50) UNIQUE NOT NULL,
branch VARCHAR(50) NOT NULL,
position VARCHAR(50) NOT NULL,
office INT NOT NULL,
dob DATE NOT NULL,
photo ?
)
;
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"employees_pkey" for table "employees"
NOTICE: CREATE TABLE / UNIQUE will create implicit index
"employees_email_key" for table "employees"
CREATE TABLE

-Carlos

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-02-10 00:33:35 Re: Relative ordering in array aggregation
Previous Message Joshua Tolley 2011-02-09 23:39:46 Compellent SAN, anyone?