Re: Allow COPY to use parameters - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Allow COPY to use parameters
Date
Msg-id 17445.1464126003@sss.pgh.pa.us
Whole thread Raw
In response to Re: Allow COPY to use parameters  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> Hm, what's the use case preparing COPY?  Note, the biggest pain point
> I have with COPY is not being able to parameterize the filename
> argument.

Yeah.  But putting a parameter symbol there (or anywhere in a utility
statement that's not part of an analyzable subexpression) introduces a
bunch of new issues.  We don't really have a notion of a specific data
type associated with most arguments of utility statements, which
complicates parse analysis (specifically, resolution of the data type to
be attributed to the parameter symbol).  And we don't have provision for
applying expression evaluation to such arguments, which is what you'd
expect to need to do to obtain the value of a parameter symbol.  In many
cases you absolutely don't want expression evaluation to happen in
utility statements, because it would complicate semantics significantly.

Bottom line is that there's a pretty large can of worms hiding under
this, and I am not eager to open it.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: To-Do item: skip table scan for adding column with provable check constraints
Next
From: Tom Lane
Date:
Subject: Re: To-Do item: skip table scan for adding column with provable check constraints