Does Postgres protocol 2 support query parameters? e.g.:
SELECT colA FROM tbl WHERE colB=$1
Some systems (Presto) are still using protocol 2, and I need to understand
the scope of changes in the middleware to support protocol 2.
wrote:
> Konstantin Izmailov writes:
> > Whole point of my question was why PG does not return
> > binary formatted field when requested (this is a feature supported in the
> > protocol).
>
> You haven't presented a test case demonstrating that that happens in
> un
ane wrote:
> Konstantin Izmailov writes:
> > Oops, I forgot to mention that we slightly modified libpq to request
> > resulting fields formats (since Postgres protocol v3 supports this).
>
> Um. I'm not that excited about supporting bugs in modified variants of
> PG. If yo
being used for about 10 years in our variant of libpq. It
works for everything except for the case with ARRAY.
Thank you for the quick reply!
On Fri, Mar 4, 2016 at 10:03 PM, Tom Lane wrote:
> Konstantin Izmailov writes:
> > I'm using libpq to read array values, and I notice
I'm using libpq to read array values, and I noticed that sometimes the
values are returned in Binary and sometimes - in Text format.
1. Returned in Binary format:
int formats[1] = { 1 }; // request binary format
res = PQexec(conn, "SELECT rgField FROM aTable", 1, formats);
assert(PQfforma
Merlin,
it worked like a charm! Thank you tons!
Konstantin
I have implemented a C++ procedure for inserting data using libpq and COPY
WITH BINARY command. All field types are working as expected in PG9.2,
except "date":
ERROR: incorrect binary data format
CONTEXT: COPY table, line 1, column date_xyz
The passed value for "date" is a 64-bit integer, c
I came across an issue that looks like a bug in COPY. There are many
similar posts, e.g.
http://stackoverflow.com/questions/13485030/strange-postgresql-value-too-long-for-type-character-varying500,
without a good unswer.
Simplified steps to reproduce the issue:
1. CREATE TABLE TEST (description va
I found a workaround: domain type defined as: CREATE DOMAIN currency AS
numeric(16,4);
Thank you!
Is it possible instead of executing following two statements:
SHOW search_path; SELECT version();
to execute just one statement returning both search_path and version?
I'm using Postgres 9.0 and need the result either as two tuples or two
fields...
Could you suggest how to rewrite the two state
Tom, thank you for the suggestion - it looks like it is working!
I've found another solution by looking into psql source code:
nspname like 'pg_temp%' AND pg_catalog.pg_table_is_visible(C.oid)
can also be added to the query for the purpose.
On 1/3/11, Tom Lane wrote:
> K
My application creates/uses a temporary table "X" via multiple
connections at the same time. Is there a way to determine which
pg_temp_N belongs to the current connection?
I need this to obtain list of attributes for the temporary table...
All connections are using the same temp table name (by des
MOVE ALL, then PQcmdTuples to get number of rows,
> then MOVE BACKWARD ALL to point cursor at initial position.
>
> 2010/12/2 Konstantin Izmailov
>
> Maybe this question was discussed previously, but I could not find an
>> answer:
>>
>> An application used PQntupl
Maybe this question was discussed previously, but I could not find an
answer:
An application used PQntuples function to obtain number of tuples after
executing each query. Since number of rows increased we decided to use
DECLARE CURSOR/FETCH commands to retrieve tuples. However, it seems that
numb
the case, then just get a PostgreSQL OLEDB provider that
> supports bookmarks.
>
>
>
> *From:* pgsql-general-ow...@postgresql.org [mailto:
> pgsql-general-ow...@postgresql.org] *On Behalf Of *Konstantin Izmailov
> *Sent:* Tuesday, November 30, 2010 9:50 PM
> *To:* pgsql-
Dear experts,
I've noticed that commercial databases (e.g. SQLServer) and some open source
databases (e.g. Cubrid) support so called "bookmarks".
As far as I understood, a bookmark allows quickly jump to a row for
retrieval or modification.
Here is scenario that I'm trying to deal with:
A BI/ETL a
o insert a duplicate row. Is using of a
SAVEPOINT only solution?
Thank you
Konstantin
On Tue, Oct 5, 2010 at 4:13 AM, Craig Ringer wrote:
> On 10/05/2010 12:39 PM, Konstantin Izmailov wrote:
>
>> Howdy,
>> I've noticed that there is a difference in result of execut
Howdy,
I've noticed that there is a difference in result of execution of the
following statement:
INSERT INTO testtable(col1) VALUES(NULL);
depending on whether the command is prepared or not.
If I call PQprepare/PQexecPrepared for the statement, the error "transaction
aborted" is returned with
}
res = ::PQexec(conn, "ABORT", 0, 0);
On Mon, Jun 28, 2010 at 9:11 AM, Konstantin Izmailov wrote:
> Looks like other people were asking similar question, but there is no
> answer:
> http://forums.devshed.com/postgresql-help-21/combine-prepare-and-declare-cursor-437562.
Looks like other people were asking similar question, but there is no
answer:
http://forums.devshed.com/postgresql-help-21/combine-prepare-and-declare-cursor-437562.html
On Mon, Jun 28, 2010 at 1:00 AM, Konstantin Izmailov wrote:
> lol
>
> Seriosly, this customer issues resulted in im
CLARE csr1 CURSOR FOR
EXECUTE abcd;
Thank you!
Konstantin
On Wed, Jun 23, 2010 at 9:41 PM, Tom Lane wrote:
> Scott Marlowe writes:
> > On Wed, Jun 23, 2010 at 10:55 PM, Konstantin Izmailov
> wrote:
> >> The company is not willing to upgrade from 7.4 to a later version due to
&g
Scott, thank you for the quick answer!
I think it would work if our software tracks which statements have already
been prepared on the connection.
On Wed, Jun 23, 2010 at 8:25 PM, Scott Marlowe wrote:
> On Wed, Jun 23, 2010 at 10:55 PM, Konstantin Izmailov
> wrote:
> > Is th
Is there a way to prevent transaction abort when preparing command in
version 7.4?
I googled but haven't been able to find the answer. The issue occurs when
our software trys to prepare a command that is already prepared (by the same
or different app). PQprepare returns error and aborts current tr
Please ignore my question. I found "Op" tokens definition in scan.l!
On Fri, Jun 4, 2010 at 6:15 PM, Konstantin Izmailov wrote:
> I'm creating my own parser/regex combination for fast and lightweight
> Postgres queries processing (in a user app). So I wanted to double check
I'm creating my own parser/regex combination for fast and lightweight
Postgres queries processing (in a user app). So I wanted to double check
some details in PG source, but could not find the geometric operators (
http://www.postgresql.org/docs/8.4/static/functions-geometry.html)
definition/rules
yep, thank you!
On Wed, May 5, 2010 at 5:47 AM, Scott Marlowe wrote:
> Should work. I'm not sure 2.5 release savepoint is necessary.
>
> On Wed, May 5, 2010 at 12:53 AM, Konstantin Izmailov
> wrote:
> > I expect that only changes on step 2.7 persisted in DB.
> >
I expect that only changes on step 2.7 persisted in DB.
On Tue, May 4, 2010 at 11:18 PM, Scott Marlowe wrote:
> On Tue, May 4, 2010 at 11:52 PM, Konstantin Izmailov
> wrote:
> > Hi,
> > I'm working on a solution that utilizes 2 phase commit protocol (between
> SQL
Hi,
I'm working on a solution that utilizes 2 phase commit protocol (between SQL
Server and PostgreSQL). Normally PostgreSQL statements sequense is:
1. START
2.
3. PREPARE TRANSACTION 'uuid'
4. COMMIT PREPARED 'uuid'
What if on step 2 user application issues statements with SAVEPOINTs, e.g.
2.1.
e
the table name changes.
Thank you tons!
On Tue, Nov 24, 2009 at 8:04 PM, Greg Stark wrote:
> On Wed, Nov 25, 2009 at 2:00 AM, Konstantin Izmailov
> wrote:
> > Greg,
> > this is brilliant - thank you very much!
> >
> > Is "partition by" compa
09 at 1:03 AM, Konstantin Izmailov
> wrote:
>
> > My question: can pg_attribute.attnum be used to determine the sequential
> > ordinal positions of columns in a table? What is a right way to get the
> > ordinal numbers?
>
> You could use something like:
>
> row_nu
Today I was contacted by a Microsoft (!) developer Kamil who was working on
issues in Linked Servers to PostgreSQL. He brought the following scenario:
if a column is dropped then ordinal positions of remaining columns are
reported incorrectly.
Here is test scenario:
1) create a table in PGAdmin:
e.
Thank you for the valuable discussion!
Konstantin
On Tue, Nov 17, 2009 at 9:16 PM, David Fetter wrote:
> On Tue, Nov 17, 2009 at 09:33:05AM -0700, Konstantin Izmailov wrote:
> > Some companies have policy to stay DB agnostic, i.e. use standard
> > SQL only.
>
> Th
n one
statement?
If PQexecParams does not support multiple statements, it needs to be
extended for the support, or new function created for the purpose. If I do
the change in libpq, may I submit the code to community?
Thank you!
Konstantin
On Mon, Nov 16, 2009 at 2:11 PM, wrote:
> Ko
I'm planning to use multiple statements via libpq. Before starting coding
I'm trying to understand are there any limitations on passing parameters.
E.g. would the following work:
PQexecParams(conn, "BEGIN;INSERT INTO tbl VALUES($1,$2);SELECT
lastval();SELECT * INTO AUDIT FROM (SELECT $3, 'tbl act
Right, the value is '$51.20'! Now I understand how to interpret the bytes -
thank you!
I had to work with an existing database and I do not know why they still use
"money" fields.
On Sun, Nov 15, 2009 at 9:38 PM, John R Pierce wrote:
> Konstantin Izmailov wrote:
>
&g
I'm trying to read "money" field using PQgetvalue (PostgreSQL 8.3.7). The
function returns 9 bytes, smth like 0h 0h 0h 0h 0h 0h 14h 0h 0h, for the
value '$50.2'. I could not find description anywhere on how to convert the
binary data into, for example, a double precision number.
Would you please h
Dear Community,
I'm working on implementation of virtual grid using DECLARE... SELECT
Advantage of virtual grid is that it loads only rows that a user is willing
to see (with FETCH).
However, it is not clear how to determine max rows count that the cursor can
return. The count is necessary for
implementation already.
On Wed, Jun 17, 2009 at 4:05 PM, Tom Lane wrote:
> Konstantin Izmailov writes:
> > Out of curiosity, what if lo object has size > 4GB, how lo_tell return
> its
> > size? Looks like this is an interface issue.
>
> That's simple: it can't have such
Out of curiosity, what if lo object has size > 4GB, how lo_tell return its
size? Looks like this is an interface issue.
I found a post dated back to 1998, when somebody pointed it out and a
posgres developer promised to fix it.
Thank you all
On Wed, Jun 17, 2009 at 3:15 PM, Konstantin Izmai
I found the reason - it was bug in my code when inserting lo object. It's
size was actually 4.
Please ignore or delete my post.
On Wed, Jun 17, 2009 at 11:38 AM, Konstantin Izmailov
wrote:
> Hi,
> I'm trying to get lo size via libpq before starting reading it (postgres
> serv
Hi,
I'm trying to get lo size via libpq before starting reading it (postgres
server 8.3.5). lo_lseek always returns 4 (actual size is > 1M).
I query table with "select photo from employee where id=''". It returns
lo oid integer as expected. Then I use following code to obtain size of the
lo obj
just cannot provide required modes due to DB
limitation.
On May 22, 2009, at 3:18 PM, Magnus Hagander
wrote:
Tom Lane wrote:
Konstantin Izmailov writes:
I've asked a few people at pgcon2009 about the issue of connecting
users
differently: some in SSIS mode, some - with password.
I've asked a few people at pgcon2009 about the issue of connecting users
differently: some in SSIS mode, some - with password. This is still an
issue: if server is configured for SSIS, there is no way to connect with
password. It appears that the solution of the issue is to introduce
connection str
Great! I will take a look and let you know. I had rewritten the Provider
about a year ago as well. However, I did not have time to clean-up most of
the new bugs and decided to keep the code for myself. There is certain
interest in the US to the more capable Provider.
On 12/15/06, Jeremy Lea <[EMA
44 matches
Mail list logo