Coder Social home page Coder Social logo

Comments (4)

dkubb avatar dkubb commented on August 19, 2024

@dbussink what do you think?

from do.

dbussink avatar dbussink commented on August 19, 2024

Right now it's not possible, because we need postgres.h for mapping error code to the appropriate exceptions. At the time I wrote that I search for another way to do that, but the only way was to use the postgres.h header for it.

@luislavena Do you know of other ways to get the Postgres error codes with just using the libpq interface?

from do.

deepfryed avatar deepfryed commented on August 19, 2024

from utils/elog.h


 56 /* macros for representing SQLSTATE strings compactly */
 57 #define PGSIXBIT(ch)    (((ch) - '0') & 0x3F)
 58 #define PGUNSIXBIT(val) (((val) & 0x3F) + '0')
 59 
 60 #define MAKE_SQLSTATE(ch1,ch2,ch3,ch4,ch5)  \
 61     (PGSIXBIT(ch1) + (PGSIXBIT(ch2) << 6) + (PGSIXBIT(ch3) << 12) + \
 62      (PGSIXBIT(ch4) << 18) + (PGSIXBIT(ch5) << 24))

from do.

dbussink avatar dbussink commented on August 19, 2024

If I look at the packaging of libpq-dev for example in Debian:

http://packages.debian.org/squeeze/amd64/libpq-dev/filelist

Here the postgres.h header and some additional ones that we use are also part of this list. I guess this is what usually ends up being the list that people require for writing a client. Therefore closing this issue, since I don't see DO being able to change this anytime soon.

from do.

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.