libpq

How can I solve Postgresql SCRAM authentifcation problem?

烂漫一生 提交于 2021-02-16 10:32:22
问题 I am getting an error after moving the project to production. The error is as follows while running with production server pg_connect(): Unable to connect to PostgreSQL server: SCRAM authentication requires libpq version 10 or above. Here is my postgreSQL version: Development Version : PostgreSQL 11.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit Production Version : PostgreSQL 11.5 (EnterpriseDB Advanced Server 11.5.12) on x86_64-pc-linux-gnu,

How can I solve Postgresql SCRAM authentifcation problem?

老子叫甜甜 提交于 2021-02-16 10:30:34
问题 I am getting an error after moving the project to production. The error is as follows while running with production server pg_connect(): Unable to connect to PostgreSQL server: SCRAM authentication requires libpq version 10 or above. Here is my postgreSQL version: Development Version : PostgreSQL 11.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit Production Version : PostgreSQL 11.5 (EnterpriseDB Advanced Server 11.5.12) on x86_64-pc-linux-gnu,

Unable to load tidycensus and map view packages on Macbook

此生再无相见时 提交于 2021-02-11 12:19:21
问题 I installed the packages tidycensus and mapview in RStudio but I get the following error when I try load either one: library(tidycensus) Error: package or namespace load failed for ‘tidycensus’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf/libs/sf.so': dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf/libs/sf.so, 6): Library not loaded: /usr/lib/libpq.5.dylib Referenced from:

How to access a HSTORE column using PostgreSQL C library (libpq)?

廉价感情. 提交于 2021-01-28 02:56:42
问题 I cannot find any documentation regarding HSTORE data access using the C library. Currently I'm considering to just convert the HSTORE columns into arrays in my queries but is there a way to avoid such conversions? 回答1: libpqtypes appears to have some support for hstore . Another option is to avoid directly interacting with hstore in your code. You can still benefit from it in the database without dealing with its text representation on the client side. Say you want to fetch a hstore field;

copy libpq.5.dylib to /usr/lib/libpq.5.dylib

倖福魔咒の 提交于 2020-12-13 17:50:09
问题 I can't load packages in R because the file libpq.5.dylib is not in /usr/lib/libpq.5.dylib . It is in /usr/local/Cellar/libpq/13.0/lib/libpq.5.dylib I tried this line: sudo ln -s /usr/local/Cellar/libpq/13.0/lib/libpq.5.dylib /usr/lib/libpq.5.dylib but I get this response: ln: /usr/lib/libpq.5.dylib: Operation not permitted What can I do to get the file in /usr/lib/libpq.5.dylib without causing issues? This solution suggests that I may face problems down the line so I don't understand what to

copy libpq.5.dylib to /usr/lib/libpq.5.dylib

别来无恙 提交于 2020-12-13 17:49:08
问题 I can't load packages in R because the file libpq.5.dylib is not in /usr/lib/libpq.5.dylib . It is in /usr/local/Cellar/libpq/13.0/lib/libpq.5.dylib I tried this line: sudo ln -s /usr/local/Cellar/libpq/13.0/lib/libpq.5.dylib /usr/lib/libpq.5.dylib but I get this response: ln: /usr/lib/libpq.5.dylib: Operation not permitted What can I do to get the file in /usr/lib/libpq.5.dylib without causing issues? This solution suggests that I may face problems down the line so I don't understand what to

Inserting a floating point number in a table using libpq

佐手、 提交于 2020-07-19 05:57:33
问题 I am inserting a floating point number in a table using libpq . I am getting this error INSERT failed: ERROR: insufficient data left in message . Here is the corresponding snippet from my code base: printf ("Enter write parameter_value"); scanf("%f", &parameter_value); char *stm = "INSERT INTO write_reg_set (parameter_value) VALUES ($1::double precision)"; int nparam = 1; //set the values to use const char *values[1] = {(char *)&parameter_value}; //calculate the lengths of each of the values

Insert Binary Large Object (BLOB) in PostgreSQL using libpq from remote machine

跟風遠走 提交于 2020-01-22 15:09:57
问题 Can you give an example of inserting binary data in PostgreSQL database from remote machine using libpq. My second question is: Is there any other API more efficient than libpq with C++. Thanks 回答1: There are 2 types of blobs in PostgreSQL — BYTEA and Large Objects . I'd recommend against using large objects as you can not join them to tables. For BYTEA you'd use something like this in libpq: PGresult* put_data_to_tablename( PGconn* conn, int32_t id, int data_size, const char* const data ) {

Insert Binary Large Object (BLOB) in PostgreSQL using libpq from remote machine

為{幸葍}努か 提交于 2020-01-22 15:09:45
问题 Can you give an example of inserting binary data in PostgreSQL database from remote machine using libpq. My second question is: Is there any other API more efficient than libpq with C++. Thanks 回答1: There are 2 types of blobs in PostgreSQL — BYTEA and Large Objects . I'd recommend against using large objects as you can not join them to tables. For BYTEA you'd use something like this in libpq: PGresult* put_data_to_tablename( PGconn* conn, int32_t id, int data_size, const char* const data ) {

How to dump PGresult

两盒软妹~` 提交于 2020-01-16 01:13:52
问题 I am trying to debug my C program that accesses a postgres database. I would like to dump the contents of PGresult using some postgres provided routine. Is there a postgres provided routine that will dump PGresult in a human readable way? I will add that as an option to the logging that will dump the contents of PGresult. Here is a related question for non-SELECT commands: How to dump PGresult for non-SELECT commands 回答1: In src/interfaces/libpq/fe-print.c there is a public function PQprint ;