RE: Can you please tell us how set this prefetch attribute in following lines.
Hi all, How to fetch certain number of tuples from a postgres table. Same I am doing in oracle using following lines by setting prefetch attribute. For oracle // Prepare query if( OCIStmtPrepare( myOciStatement, myOciError, (text *)aSqlStatement, // Get statement type OCIAttrGet( (void *)myOciStatement, OCI_HTYPE_STMT, &statement_type, 0, OCI_ATTR_STMT_TYPE, myOciError ); // Set prefetch count OCIAttrSet( myOciStatement, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, myOciError ); // Execute query status = OCIStmtExecute( myOciServerCtx, myOciStatement, myOciError, iters, 0, NULL, NULL, OCI_DEFAULT ); For Postgres Can you please tell us how set this prefetch attribute in following lines. Is PQexec returns all the rows from the table? mySqlResultsPG = PQexec(connection, aSqlStatement); if((PQresultStatus(mySqlResultsPG) == PGRES_FATAL_ERROR ) || (PQstatus(connection) != CONNECTION_OK)){} if ((PQresultStatus(mySqlResultsPG) == PGRES_COMMAND_OK) || (PQresultStatus(mySqlResultsPG) == PGRES_TUPLES_OK)) { myNumColumns = PQnfields(mySqlResultsPG); myTotalNumberOfRowsInQueryResult = PQntuples(mySqlResultsPG); myCurrentRowNum = 0 ; } Regards Tarkeshwar
Facing issue in using special characters
Hi all, Facing issue in using special characters. We are trying to insert records to a remote Postgres Server and our application not able to perform this because of errors. It seems that issue is because of the special characters that has been used in one of the field of a row. Regards Tarkeshwar
integrate Postgres Users Authentication with our own LDAP Server
Hi all, We would need to integrate Postgres Users Authentication with our own LDAP Server. Basically as of now we are able to login to Postgress DB with a user/password credential. [cid:image001.png@01D50650.D807AE30] These user objects are the part of Postgres DB server. Now we want that these users should be authenticated by LDAP server. We would want the authentication to be done with LDAP, so basically the user credentials should be store in LDAP server Can you mention the prescribed steps in Postgres needed for this integration with LDAP Server? Regards Tarkeshwar
RE: integrate Postgres Users Authentication with our own LDAP Server
We want to setup ldap authentication in pg_hba.conf, for Postgresql users(other than postgres super user). We are getting issue with special characters by following steps given in postgres documentation. It is not accepting any special characters as special characters are mandatory in our use case. Can you please help us or have you any steps by which we can configure any postgres with LDAP? -Original Message- From: Laurenz Albe Sent: Thursday, May 9, 2019 12:12 PM To: M Tarkeshwar Rao ; pgsql-general ; 'postgres-disc...@mailman.lmera.ericsson.se' ; 'pgsql-gene...@postgresql.org' ; pgsql-performa...@postgresql.org; pgsql-hack...@postgresql.org; 'pgsql-hackers-ow...@postgresql.org' ; Aashish Nagpaul Subject: Re: integrate Postgres Users Authentication with our own LDAP Server On Thu, 2019-05-09 at 04:51 +, M Tarkeshwar Rao wrote: > We would need to integrate Postgres Users Authentication with our own LDAP > Server. > > Basically as of now we are able to login to Postgress DB with a user/password > credential. > > [roles "pg_signal_backend" and "postgres"] > > These user objects are the part of Postgres DB server. Now we want that these > users should be authenticated by LDAP server. > We would want the authentication to be done with LDAP, so basically > the user credentials should be store in LDAP server > > Can you mention the prescribed steps in Postgres needed for this integration > with LDAP Server? LDAP authentication is well documented: https://www.postgresql.org/docs/current/auth-ldap.html But I don't think you are on the right track. "pg_signal_backend" cannot login, it is a role to which you add a login user to give it certain privileges. So you don't need to authenticate the role. "postgres" is the installation superuser. If security is important for you, you won't set a password for that user and you won't allow remote logins with that user. But for your application users LDAP authentication is a fine thing, and not hard to set up if you know a little bit about LDAP. Yours, Laurenz Albe -- Cybertec | https://protect2.fireeye.com/url?k=4f372c5d-13a52101-4f376cc6-0cc47ad93d46-aed009fdc0b3e18f&u=https://www.cybertec-postgresql.com/