Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replication protocol requires "use simple queries only" #558

Closed
Gordiychuk opened this issue May 10, 2016 · 6 comments
Closed

Replication protocol requires "use simple queries only" #558

Gordiychuk opened this issue May 10, 2016 · 6 comments

Comments

@Gordiychuk
Copy link
Contributor

@Gordiychuk Gordiychuk commented May 10, 2016

I found few PR about support the simple query format for v3 protocol #365 and #450 . But all PR was close without merge.

I add support replication protocol in PR #550 and found problem with current v3 protocol implementation - Absent ability execute statement as simple query(only extended query). But in walsender mode only the simple query protocol can be used, see Streaming Replication Protocol. As result even org.postgresql.jdbc.PgConnection#isValid fail with exception that not allow use pooling for replication connections.

What about execute all query without parameters and not prepared as simple query? Is it real or need add additional flag about ability use the simple query protocol if it available in specific case?

I also think that will be good if backend will reply us after start package which query mode available for use: extended or simple.

@Gordiychuk
Copy link
Contributor Author

@Gordiychuk Gordiychuk commented May 10, 2016

I want to know your opinions before implementing.

@davecramer
Copy link
Member

@davecramer davecramer commented May 10, 2016

the previous PR's were closed because there wasn't a need for them. If you
require simple query format for Replication Protocol than I would consider
that a "need" In other words I would accept it.

As for the backend replying, you'd have to take that up with hackers.

Dave Cramer

On 10 May 2016 at 18:14, Vladimir Gordiychuk notifications@github.com
wrote:

I want to know your opinions before implementing.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#558 (comment)

@vlsi vlsi changed the title Replication protocol required support the simple query protocol for v3 Replication protocol requires "use simple queries only" May 13, 2016
@zapov
Copy link
Contributor

@zapov zapov commented Jun 14, 2016

There was need for them (I created them because Postgres was hanging with current codebase).
But there was not a clean way to introduce them into the codebase so I just replicated part of the driver functionality in an external application.

@davecramer
Copy link
Member

@davecramer davecramer commented Jun 14, 2016

@zapov so are we closing this ?

@zapov
Copy link
Contributor

@zapov zapov commented Jun 14, 2016

I would like to have support for "simple queries" within JDBC, but I can't work on that now.
I solved my immediate problem, so it's not a pressing issue for me.
I planned on revisiting driver in the future, so I can try it for the third time, but last time I asked there was not even a consensus if v3Q is a good idea.

So we can leave this open and lay out basic design (such as non prepared statements = v3Q, prepared statements = v3Extended, etc)

@davecramer
Copy link
Member

@davecramer davecramer commented Jun 14, 2016

Sure, np. Thanks. Look forward to it

vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 7, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, if "simpleProtocolOnly=true" property is set, QueryExecutor switches to
simple execute only commands. This is not optimal as it does not support binary, and
some features (like statement metadata) do not work.

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 9, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, if "simpleProtocolOnly=true" property is set, QueryExecutor switches to
simple execute only commands. This is not optimal as it does not support binary, and
some features (like statement metadata) do not work.

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 9, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, if "simpleProtocolOnly=true" property is set, QueryExecutor switches to
simple execute only commands. This is not optimal as it does not support binary, and
some features (like statement metadata) do not work.

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 10, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, if "simpleProtocolOnly=true" property is set, QueryExecutor switches to
simple execute only commands. This is not optimal as it does not support binary, and
some features (like statement metadata) do not work.

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 10, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, if "simpleProtocolOnly=true" property is set, QueryExecutor switches to
simple execute only commands. This is not optimal as it does not support binary, and
some features (like statement metadata) do not work.

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 10, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, if "simpleProtocolOnly=true" property is set, QueryExecutor switches to
simple execute only commands. This is not optimal as it does not support binary, and
some features (like statement metadata) do not work.

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 11, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 11, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 11, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 11, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 11, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 11, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 12, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 12, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
vlsi added a commit to vlsi/pgjdbc that referenced this issue Aug 13, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
closes pgjdbc#618
@vlsi vlsi closed this in 232569c Aug 13, 2016
zemian pushed a commit to zemian/pgjdbc that referenced this issue Oct 6, 2016
To execute a query in simple mode, QueryExecutor.QUERY_EXECUTE_AS_SIMPLE flag should be used.
Alternatively, preferQueryMode can be used to control the desired execution mode.

preferQueryMode can have the following values:
  extended (default): send all queries as extended (parse, bind, exec)
  simple: send all queries as simple 'Q'
  extendedForPrepared: send prepared statements as extended, and non-prepared statements as 'Q'

Note: simple execution mode does not support binary formats, it does not support statement metadata, etc.

Other changes: support timestamp, timestamptz, date, time, timetz, point, box, and uuid types in simple execution mode

closes pgjdbc#558
closes pgjdbc#618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants