Re: Storing Documents

Поиск
Список
Период
Сортировка
От Mitch Pirtle
Тема Re: Storing Documents
Дата
Msg-id 330532b6050309113610febe1f@mail.gmail.com
обсуждение исходный текст
Ответ на Storing Documents  (<operationsengineer1@yahoo.com>)
Список pgsql-novice
Hey operationsengineer1,

On Wed, 9 Mar 2005 09:39:03 -0800 (PST), operationsengineer1@yahoo.com
<operationsengineer1@yahoo.com> wrote:
>
> is this the best way?  is there a hidden *gotcha*
> involved that i might need to be aware of?

Here is a trick I have learned over the years:

Step 1:
CREATE TABLE filebase (
  id serial NOT NULL PRIMARY KEY,
  filename varchar(128) NOT NULL
)

Step 2:
Have your scripts save the uploaded file as /usr/share/filebase/(id)

Step 3:
Always reference your 'filename' throughout application. That way you
don't have to worry about duplicate filenames overwriting each other
(unpleasant)... If you wanted simple version control, you could also
create a second table that stored versions for each row in the
filebase table.

-- Mitch

-- Mitch

В списке pgsql-novice по дате отправления:

Предыдущее
От: Sean Davis
Дата:
Сообщение: Re: VERY basic psql and schema question
Следующее
От: Kumar S
Дата:
Сообщение: Duplication error . please help.