su - postgres psql Password: /usr/bin/psql: line 19: use: command not found /usr/bin/psql: line 20: use: command not found /usr/bin/psql: line 21: use: command not found /usr/bin/psql: line 22: use: command not found /usr/bin/psql: psql: line 24: syntax error near unexpected token `$version,' /usr/bin/psql: psql: line 24: `my ($version, $cluster);'
su - postgres -c psqlif you do it in a single command.
PGobjectbut it doesn't seem to like it.
ARRAY[ ROW(...)]::typeName]::typeNamewhich I have used in direct queries but it is telling to me start my arrays with
Hi Channel , Currently I am using doobie Hikari connection to connect to postgres database and get the result of API request which internally has 3 methods which individually call the postgres for data pool. I have below 2 approaches to perform this task :
Using Hikari Transactor with datasource :
In this scenario for every internal postgres call, Transactor is creating a single connection to database but not able to shutdown the same connection pool after request completion.
Advantage : It is creating a single connection pool and executed all internal calls in a single created connection pool.
Disadvantage : A lot of ideal connection remains open.
Using Resource :
In this scenario for every internal postgres call, Resource is creating a new connection pool to database and after completion of each request it shutdown the connection pool. example :
INFO c.z.h.HikariDataSource - HikariPool-6 - Starting... INFO c.z.h.HikariDataSource - HikariPool-4 - Starting... INFO c.z.h.HikariDataSource - HikariPool-5 - Starting... INFO c.z.h.HikariDataSource - HikariPool-5 - Start completed. INFO c.z.h.HikariDataSource - HikariPool-6 - Start completed. INFO c.z.h.HikariDataSource - HikariPool-4 - Start completed. INFO c.z.h.HikariDataSource - HikariPool-5 - Shutdown initiated... INFO c.z.h.HikariDataSource - HikariPool-5 - Shutdown completed. INFO c.z.h.HikariDataSource - HikariPool-6 - Shutdown initiated... INFO c.z.h.HikariDataSource - HikariPool-6 - Shutdown completed. INFO c.z.h.HikariDataSource - HikariPool-4 - Shutdown initiated... INFO c.z.h.HikariDataSource - HikariPool-4 - Shutdown completed.
Advantage : Resource is handling the starting and shutdown of created connection pools. Very few ideal connection remains open
Disadvantage : Creating a connection pool for every single request which might lead to more overhead to memory.
I am little bit confused on which approached is better suited for my scenario.
@narala558 More information would be helpful... which OS? And which version of PostgreSQL are you running now?
I posted about my experience here, if you're interested:
SELECT json_build_object( "id", "simpleRecipeProductOption".id, "type", "simpleRecipeProductOption"."type", "price", "simpleRecipeProductOption"."price"->0->>"value" ) FROM "onlineStore"."simpleRecipeProductOption" WHERE id = 192;
postgres-error : column "value" does not exist
so i have a intresting problem , does anyone know a good way to solve this:
given a table
and given a table
i wnat the issue id to be of form
project.prefix-autoincremented value ex
P1-01 , P1-02.... P2-01... so on.
I cant do this at application level by reading the no of issue count & adding +1 to it since it will have concurrency issues
startupmessage. But when I send a
Parsemessage, I do not get any response from the server. The protocol says that I should get
ParseCompletemessage back. One reason can be that the server is waiting for some more data from client. Maybe I should try sending a
bindquery after it ?
How can i store skills in skill_s text array?
jsonObject json =
"Name": "Kshitiz Kala",
"Skills": ["enim", "aliquip", "qui"]
SELECT jsonObject::TEXT->'Skills' into skill_s;
raise info 'JSON value Name is %', skill_s;
I need to print like this enim, aliquip, qui
Roughly what kind of performance difference can I probably expect between the following, assuming several million tags stored, and with each result being about 1000 tags
# Assume a 1-to-1 relationship & indexed tag_id tag(tag_id, name) tag_weight(tag_id, weight) SELECT t.tag_id, t.name, tw.weight FROM tag t INNER JOIN tag_weight tw ON t.tag_id = tw.tag_id WHERE t.name = 'abc' and tw.weight > 50;
tag(tagId, name, weight) SELECT t.tag_id, t.name, t.weight FROM tag t WHERE t.name = 'abc' and t.weight > 50;
pg_recvlogicaland I have a small question. There is something that I didn't understand: if I restart
pg_recvlogical, changes that I already received are emitted again. Is there some way to say to Postgres: "I acknowledge receiving this event, you can set your cursor to the next one" in order not to receive changes again?