Обсуждение: Fwd: Extended query protocol and exact types matches.

Поиск
Список
Период
Сортировка

Fwd: Extended query protocol and exact types matches.

От
Dmitriy Igrishin
Дата:


---------- Forwarded message ----------
From: Dmitriy Igrishin <dmitigr@gmail.com>
Date: 2010/12/10
Subject: Fwd: Extended query protocol and exact types matches.
To: postgres list <pgsql-sql@postgresql.org>


Hey sql@,


---------- Forwarded message ----------
From: Dmitriy Igrishin <dmitigr@gmail.com>
Date: 2010/12/9
Subject: Extended query protocol and exact types matches.
To: pgsql-general@postgresql.org


Hey general@,

To be assured and just for calmness.

Problem:

1. CREATE TABLE test_tab (id integer, dat varchar(64));

2. INSERT INTO test_tab VALUES($1, $2) via PQexecParams,
 where paramTypes[0] == OID of bigint,
           paramTypes[1] == OID of text.

Questions:

Whether this case falls to
http://www.postgresql.org/docs/9.0/static/typeconv-query.html ?

Is such cases safe or it is recommended (best) to specify a
OIDs which are exact matches ?

PS.

I know, that queries like SELECT $1 does not work without
specifying OID or without rewriting it to e.g. SELECT $1::text.

Thanks.

--
// Dmitriy.





--
// Dmitriy.





--
// Dmitriy.


Re: Fwd: Extended query protocol and exact types matches.

От
Robert Haas
Дата:
On Fri, Dec 10, 2010 at 2:53 AM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
> [ message that was forwarded to three mailing lists in an 12 hour period ]

Come on, give me a break!  How quickly do you expect people to answer
your questions?  It's reasonable to follow up if you haven't heart
anything in a few days, but this is ridiculous.  And you might want to
follow up to the original list first, rather than a different one.
Like this: "I see that no one responded to this email...  can anyone
help me out on this?  If there's additional information that I should
provide, please let me know what would be helpful.  Thanks!"

If you want people to give a higher priority to your questions than
they're willing to do for free, you need a commercial support
contract.  If you want answers to routine questions within a handful
of hours, you probably need an *expensive* commercial support
contract.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Fwd: Extended query protocol and exact types matches.

От
Dmitriy Igrishin
Дата:
Hey Robert,

2010/12/10 Robert Haas <robertmhaas@gmail.com>
On Fri, Dec 10, 2010 at 2:53 AM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
> [ message that was forwarded to three mailing lists in an 12 hour period ]

Come on, give me a break!
Please sorry ! But I don't mail to you personally.
 How quickly do you expect people to answer
your questions?  It's reasonable to follow up if you haven't heart
anything in a few days, but this is ridiculous.
Where is it written how many time I should wait before reask/forward ?
But sorry for this anyway !
 And you might want to
follow up to the original list first, rather than a different one.
Where is it written ?
Like this: "I see that no one responded to this email...  can anyone
help me out on this?  If there's additional information that I should
provide, please let me know what would be helpful.  Thanks!"
Thanks for the advice !

If you want people to give a higher priority to your questions than
they're willing to do for free, you need a commercial support
contract.  If you want answers to routine questions within a handful
of hours, you probably need an *expensive* commercial support
contract.
Thanks for the offer ! As soon as there will be money without fail we
will think over it.

It would be quicker to answer my question and help than to teach me
the alphabet of communication. Although, thank you, and for that :-)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
// Dmitriy.


Re: Fwd: Extended query protocol and exact types matches.

От
Robert Haas
Дата:
On Fri, Dec 10, 2010 at 11:46 AM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
> It would be quicker to answer my question and help than to teach me
> the alphabet of communication. Although, thank you, and for that :-)

It would be quicker still to ignore your email altogether, but I'm
guessing you're not going to recommend that I take that approach.  I
did look briefly at whether I could also answer the question while I
was replying, but found that I wasn't really sure what you were asking
(which may be why no one else responded either).  To the best of my
ability to determine what you were actually asking, it was something
along the lines of "What will happen if I tell libpq that a parameter
is a bigint when the server is expecting an int?".  I don't happen to
know the answer to that question without writing a 25-line program,
compiling it, and testing it.  Which wouldn't be very hard, but on the
other hand it wouldn't be very hard for you to do it either.  Best
guess without testing?  It'll work if the value is within the range
that can be represented by an int and throw an error otherwise.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Fwd: Extended query protocol and exact types matches.

От
Dmitriy Igrishin
Дата:


2010/12/10 Robert Haas <robertmhaas@gmail.com>
On Fri, Dec 10, 2010 at 11:46 AM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
> It would be quicker to answer my question and help than to teach me
> the alphabet of communication. Although, thank you, and for that :-)

It would be quicker still to ignore your email altogether, but I'm
guessing you're not going to recommend that I take that approach.
Sure not !
 I
did look briefly at whether I could also answer the question while I
was replying, but found that I wasn't really sure what you were asking
(which may be why no one else responded either).
 I've got one useful respond before this post in general@.
 To the best of my
ability to determine what you were actually asking, it was something
along the lines of "What will happen if I tell libpq that a parameter
is a bigint when the server is expecting an int?".  I don't happen to
know the answer to that question without writing a 25-line program,
compiling it, and testing it.  Which wouldn't be very hard, but on the
other hand it wouldn't be very hard for you to do it either.  Best
guess without testing?  It'll work if the value is within the range
that can be represented by an int and throw an error otherwise.
Yes, I've already investigated it, compiled and tested. The first line of
my initial post says: "To be assured and just for calmness.". :-)


--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
// Dmitriy.