Coder Social home page Coder Social logo

Comments (9)

theory avatar theory commented on June 12, 2024

Ugh. I sure would like to do away with the C code again, but it really was the best way to fix #315. Need to give this some thought.

from pgtap.

spencerbryson avatar spencerbryson commented on June 12, 2024

It isn't fully clear when this is appropriate to use, but looking at the C function is it safe enough to consider marking the extension as 'trusted'? Could be the least amount of friction... something to consider.

For reference: https://www.postgresql.org/about/featurematrix/detail/347/

from pgtap.

ewie avatar ewie commented on June 12, 2024

The extension must be marked with superuser=true (which we forgot in #315) because C is an untrusted language. When also setting trusted=true all the extension scripts and functions must follow a secure design. So it's not just the C function that needs to be checked here.

from pgtap.

ewie avatar ewie commented on June 12, 2024

But I think trusted=true is not advisable if pgTAP relies on the search path as David explained: #325 (comment)

from pgtap.

theory avatar theory commented on June 12, 2024

I'm sorely tempted to dump the C code and replace it with your POC, @ewie. And also submitting a patch to get parseTypeString() exposed in SQL in core.

from pgtap.

ewie avatar ewie commented on June 12, 2024

I'm sorely tempted to dump the C code and replace it with your POC, @​ewie.

Your call, but it does seem like the best choice here.

And also submitting a patch to get parseTypeString() exposed in SQL in core.

Yeah, I was thinking about that too the last few days. You may still get it into pg17 with commitfest 2024-03 before feature freeze. Pre-17 releases should be stable enough for my PoC to cover all types (interval still todo).

from pgtap.

theory avatar theory commented on June 12, 2024

I can take a stab at it, but I can't tell where the SQL function is created; it's not like extensions with CREATE FUNCTION statements.

from pgtap.

theory avatar theory commented on June 12, 2024

Started a patch in theory/postgres#1.

from pgtap.

ewie avatar ewie commented on June 12, 2024

I can take a stab at it, but I can't tell where the SQL function is created; it's not like extensions with CREATE FUNCTION statements.

Builtin functions are defined in src/include/catalog/pg_proc.dat. Picking an OID is described in
https://www.postgresql.org/docs/current/system-catalog-initial-data.html.

from pgtap.

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.