Git Product home page Git Product logo

Comments (10)

wwoytenko avatar wwoytenko commented on September 22, 2024 1

Give me a few minutes I will think about workaround

from greenmask.

TCY16 avatar TCY16 commented on September 22, 2024 1

looking into this more, I suspect it's still on my side. I'll close this issue for now. Thanks again for the lightning quick support!

from greenmask.

wwoytenko avatar wwoytenko commented on September 22, 2024

Hi! That kind of interesting thing. Is the user from whom you're running a greenmask a super user of postgresql instance?

from greenmask.

wwoytenko avatar wwoytenko commented on September 22, 2024

If the user you're running a backup on is not the owner of a large object, is not a super user, and doesn't have grants on this object the error on opening a large object is expected. You can check it by running a query

begin; SELECT lo_open(loid, 75897); rollback;

from greenmask.

TCY16 avatar TCY16 commented on September 22, 2024

I just verified, it's not the super user. Is that a hard requirement? I'm using the simple dump as a test to eventually work my way up to obfuscate an entire database.

from greenmask.

wwoytenko avatar wwoytenko commented on September 22, 2024

There is one problem that I don't know how to resolve it correctly. On the one hand, Large Objects are independent objects in PostgreSQL, on another hand, you can reference these objects in the table record in any way. It rather depends on the logic you have. That's why the pg_dump utility originally does not have an option for skipping large objects dumps. And that's why we didn't decide to introduce this option in greenmask. But, since we are working with database obfuscation we might want to get rid of large objects or leave them empty without data. And it looks worthy to implement.

The simplest way to overcome this issue is to introduce two options in greenmask

  • --no-large-objects - do not dump large objects at all. But if you have references in tables on those objects you will receive the error during restoration. You will be forced to create empty large objects or set NULL values on references
  • --large-object - inclusive list of large objects we want to dump. Other large objects will be skipped

What do you think about those options? Are they worthy of implementation?

But for now, without a patch with the options above, or without having the proper grants on the objects, I suspect you can't make a backup in that case.

from greenmask.

TCY16 avatar TCY16 commented on September 22, 2024

Thanks for the quick and detailed response, I really appreciate it!
I think the solution for my problem will have to be on my end, i.e get superuser access. I'm not super familiar with pg_dump or even large objects, but I can imagine a --no-large-objects could be useful for other use cases.

from greenmask.

wwoytenko avatar wwoytenko commented on September 22, 2024

Thank you! I will raise a feature request for this option tomorrow.

from greenmask.

TCY16 avatar TCY16 commented on September 22, 2024

I found something else that is interesting: I tried creating a dump with the same config for multiple different tables, but I always get the same error. I checked and saw that these tables do not have any BLOB types. Could this be an error? Or could I be missing something in my setup?

from greenmask.

wwoytenko avatar wwoytenko commented on September 22, 2024

The large object dumper is independent from table dumper, whether table has references on LO or not. The problem is that even if you listed inclusively required tables the large object dumper will run anyway. That's why the option we discussed might be helpful

from greenmask.

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.