Re: [HACKERS] the parsing of parameters

2002-05-27 Thread Bruce Momjian
Jan Wieck wrote: > Tom Lane wrote: > > Jan Wieck <[EMAIL PROTECTED]> writes: > > >> Hmm. So your vision of PREPARE would allow the backend to reply > > >> with a list of parameter types. How would you envision that working > > >> exactly? > > > > > I guess there's some sort of statement ide

Re: [HACKERS] the parsing of parameters

2002-05-10 Thread Jan Wieck
Tom Lane wrote: > Jan Wieck <[EMAIL PROTECTED]> writes: > >> Hmm. So your vision of PREPARE would allow the backend to reply > >> with a list of parameter types. How would you envision that working > >> exactly? > > > I guess there's some sort of statement identifier you use to > > refe

Re: [HACKERS] the parsing of parameters

2002-05-10 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: >> Hmm. So your vision of PREPARE would allow the backend to reply >> with a list of parameter types. How would you envision that working >> exactly? > I guess there's some sort of statement identifier you use to > refer to something you've prepare

Re: [HACKERS] the parsing of parameters

2002-05-10 Thread Jan Wieck
Tom Lane wrote: > Jan Wieck <[EMAIL PROTECTED]> writes: > > There are DB interfaces that allow a generic application to > > get a description of the result set (column names, types) > > even before telling the data types of all parameters. > > > Our ODBC driver for example

Re: [HACKERS] the parsing of parameters

2002-05-10 Thread Karel Zak
On Fri, May 10, 2002 at 11:17:39AM -0400, Tom Lane wrote: > Jan Wieck <[EMAIL PROTECTED]> writes: > > Tom Lane wrote: > >> For this particular application, at least, I do not see the value ... > >> in fact this seems more likely to break stuff than help. If the > >> application does not know what

Re: [HACKERS] the parsing of parameters

2002-05-10 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> For this particular application, at least, I do not see the value ... >> in fact this seems more likely to break stuff than help. If the >> application does not know what the datatypes are supposed to be, >> how is it going to call the pr

Re: [HACKERS] the parsing of parameters

2002-05-10 Thread Jan Wieck
Tom Lane wrote: > Jan Wieck <[EMAIL PROTECTED]> writes: > > I have a little patch that actually allows SPI_prepare() to > > use UNKNOWN_OID in the passed in parameter type array and > > put's the choosen datatypes Oid back into there. > > > The parser treats those parame

Re: [HACKERS] the parsing of parameters

2002-05-09 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > I have a little patch that actually allows SPI_prepare() to > use UNKNOWN_OID in the passed in parameter type array and > put's the choosen datatypes Oid back into there. > The parser treats those parameters like single quoted

Re: [HACKERS] the parsing of parameters

2002-05-09 Thread Jan Wieck
Tom Lane wrote: > Neil Conway <[EMAIL PROTECTED]> writes: > > nconway=> prepare q2 as select $1; > > ERROR: Parameter '$1' is out of range > > > (You'll see the same parse error with simply "select $1;") > > You need to tell the parser the number of parameters to expect and their > datatypes. Th

Re: [HACKERS] the parsing of parameters

2002-05-01 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > nconway=> prepare q2 as select $1; > ERROR: Parameter '$1' is out of range > (You'll see the same parse error with simply "select $1;") You need to tell the parser the number of parameters to expect and their datatypes. This is what the last two argume