Thread: Re: [NOVICE] Loading current_user and current_timestamp using COPY

Re: [NOVICE] Loading current_user and current_timestamp using COPY

From
"Josh Berkus"
Date:
Herb,

> Right now I'm loading 1,500 test records in my largest table...but I
> don't
> want to do inserts...I'll stay with COPY and ignore the NULLS for
> now.
> In the future, however, I could be bulk loading up to 60,000 records.
> Of course, all records after that will be inserts, so perhaps the
> point is
> moot. Although...if COPY can handle the now() function, it should be
> able
> to handle the current_user/current_timestamp without too much
> overhead.
> Well....thanks for the help

Sorry I couldn't be more help.  I haven't seen any answers on the SQL
list.  I can think of several workarounds, depending on what kind of a
user interface you're using, such as having a linked batches table.

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco

Attachment

Re: [NOVICE] Loading current_user and current_timestamp using COPY

From
Tom Lane
Date:
>> Although...if COPY can handle the now() function, it should be able 
>> to handle the current_user/current_timestamp without too much overhead.

Eh?  COPY most assuredly does not handle the now() function, nor any
other function call.

It will accept 'now' --- no parens --- as an input for datetime
datatypes, but that's because those datatypes do, not because COPY
is doing anything special.

IMHO the entire point of COPY is to load bulk data as quickly as
possible ... if you want any convenience processing done for you,
you should be using INSERT not COPY.
        regards, tom lane