Code Monkey home page Code Monkey logo

Comments (5)

laurenz avatar laurenz commented on July 19, 2024

This is a shortcoming of pgreplay I hadn't been aware of.

Unfortunately there is nothing I can do about it.

In a query like this, the client would send data type information in the BIND message so that there is no ambiguity (otherwise you'd get just the same error).
But this information is not logged, and so pgreplay cannot replay it.

Unless you don't have a lot of these statements, it shouldn't be a big problem; all that happens is that you will have a slightly higher error count than in the original run.

I have added documentation about this to the README file.

from pgreplay.

Ypiskare avatar Ypiskare commented on July 19, 2024

Hi Luarenz,

I found a workaround for the issue.
Everything will work correctly if I replace in my example of the logged statement $1 + $2 with $1::nemeric + $2.

So, more general replacment is:

sed -i 's/($[0-9]+)( *[^,] *$)/\1::numeric\2/g' postgres_log_file.csv

Regards,
Yury

from pgreplay.

Ypiskare avatar Ypiskare commented on July 19, 2024

Hi Luarenz,

I found a workaround for the issue.
Everything will work correctly if I replace in my example of the logged statement $1 + $2 with $1::nemeric + $2.

So, more general replacment is:

sed -i 's/($[0-9]+)( *[^,] *$)/\1::numeric\2/g' postgres_log_file.csv

Regards,
Yury

from pgreplay.

laurenz avatar laurenz commented on July 19, 2024

Yes, certainly – if you write the query in a way that it does not require the data type information, it will replay without an error.

That sed command will certainly solve the problem if you have no other statements of the form $1 + $2 in your log. $1 could be a date value...

Do you want to keep this issue open for a certain reason?

from pgreplay.

Ypiskare avatar Ypiskare commented on July 19, 2024

Ah! You are right! I forgot about date type. But I'm sure I can write more complex handler of postgres log if needed.

Many thanks for answers. You may close the issue.

Regards,
Yury

from pgreplay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.