Postgresql Questions
Ad
Laravel/PDO JSONPATH request on Postgresql
I am trying to make a jsonpath request on a postgresql with laravel/pdo. here is what i need to archieve. select i.id as id,
Postgresql query where statement positions
I have two tables that i want to join. it works without where conditions. after adding where conditions, i got syntax error near a
Column doesn't exist error when trying to insert new value to table (on heroku using nodejs and pg library)
I'm playing with an app on heroku. it uses heroku postgresql but i have trouble inserting data to it. the code looks as follows:
Using Aggregation and Summarization in Postgresql
I have a simple query that is designed to summarize total_miles based on a group by aggregation of other columns:
JOINING tables with two conditions or two columns in common in PostgreSQL
Postgresql question: i have two tables. table 1 has item, color, and size for all items in the store. table 2 is a pricing list and has item,
sql query that depends on each value of other table
I'm not used to query sentences and this one is a bit tricky, i don't know even if it is possible (at least with just a single sql query) or if i
Division in group by SQL table
I have the following sql code select (count(*) filter (where has_a)) as count_a, count(*) as total_count, process_date from(select
Postgres syntax error in IF statement with NOT EXIST statement
I want to use if statement in insertion. insert into <table_name>(<columns>) values (if not exists
Unpivot in postgres with a column created in the same query
I am trying to unpivot a table with postgresql as described here. my problem is that i
Ad
How to save a list of numbers to Django model
I am pulling some data from an api and i want to store it in my django model. the data is a baseball inning and then runs scored that inning and
Concatenate string instead of just replacing it
I have a table with standard columns where i want to perform regular inserts. but one of the columns is of type
Select second most recent date from inner join
I have this query : select companies.display_name, companies.pay_schedule_id, pay_schedule_periods.schedule_id,
Incorrect auto-generated SQL query in Spring Boot (JPA) CrudRepository
My repository interfaces: songsrepository: public
how to delete the only the rows in postgres but not to drop table using pandas read_sql_query method?
I wanted to perform an operation where i would like to delete all the rows(but not to drop the table) in postgres and update with new rows in it.
Store enum in database
I have a database for a job advertisement web application for an assignment at university. i have a lot of enumeration values in database such as
How can I cause an UPDATE query to throw an error?
In my database i have the following table table "public.session" column | type | modifiers
search by full text does not return all results
I have the following table, with these columns first_name
Postgres database export and import, problem with $$PATH$$
I am in the process of doing export and import with postgres database. i had used the following command to take the backup of
SQL: get rows "under" chosen row
I have a table like that id name
SQL join by non null values
I have the following table: filters
Ad
How to prevent Write Ahead Logging on just one table in PostgreSQL?
I am considering log-shipping of write ahead logs
What happens to an open cursor after rolling back the transaction in Postgres using Psycopg2?
I am trying to copy a list of csv files into postgres using psycopg2's
How to export Postgres resultset as CSV from remote db connection to local machine?
I'm working on exporting resultset data from remote postgresql db to my local machine using psycopg2. i
Can I pass to npm which DB connection to use using environment variable?
I have a db connection in a js file
Passing parameter after query result (ExpressJS)
I am using expressjs & postgresql how to get parameter after query result in expressjs outside function this is my code
How do I set a foreign key for a Sequelize model?
This is very basic, and should work.. but doesn't. so first my models: const conversation = sequelize.define('conversation', {
How can I spin up multiple node js services inside of a single docker compose?
So what i want to do is to have 2 docker container running(mongodb and postgres) both of these are working. now what i want to do is to create 2
Select param when not null or another param
Select coalesce(a.task_id,b.task_id) as task_id,b.task_name as name from table_a as a full outer join table_b as b on a.task_id =
Postgres and Laravel search query
I have a query for multiple searches, the problem is with one of them, i get a correct result from it, but in combination with the rest, i get the
psycopg2.ProgrammingError: column cons.consrc does not exist
I am working on a web app where i needed to update the postgres(12) database. i am using flask-migrate for the purpose. i have tried to
Why does my sql multi-row insertion query contain a syntax error?
I am processing a post request with nodejs on heroku and trying to insert the json into a postgres db. const client = await
Ad
Intercepting knex.js queries pre-execution
I'm working on caching strategies for an application that uses knex.js for all sql related stuff. is there a way to intercept the query to check
allowNull:false and required:true did not validate null string input
My app is running nodejs 10.16 and sequelizejs 5.7 with postgresql 11. the initial connection is setup as: const sql =
Full text search with Laravel and Postgresql
I try to do a full text search, but i got stuck in a error. migration: public function up() {
Knex.js PostgreSQL column reference "id" is ambiguous
I am trying to select a single item from a collection in my database using knex.js, but getting the error column reference "id" is
Default value in Knex migration for an specific type of text array not working
I am creating a database migration using knex (v0.19.5) and postgresql (v10.1) but when i try to set the default value to a text
Mapping data in Laravel
I am not able to understand the response for api in laravel, it is confusing. i expect this output {
Postgres Issue: prompt has changed
Test=# select count(id) from person' test'#
Postgresql how do I aggregate the data in a table to produce a summarized table with unique values in a range
So, i am new to postgresql. my data is as follows: product wknum sales hammer 1 17 hammer 2 20 hammer 3 17 hammer 4 10
PostgreSQL conditional select throwing error
I have a postgresql database hosted on heroku which is throwing me this error that i can't wrap my head around. create table people
Potsgres SQL: select timestamp prior to max timestamp
I have a table in postgres with timestamps: timestamp 2022-01-01 00:52:53 2022-01-01 00:57:12 ... 2022-02-13 11:00:31 2022-02-13
Fetch users posts count in laravel
I have for me hard but for you very easy problem.i have jobs table and users table and i want to fetch users jobs count from database.
Ad
PostgreSQL error when run migration Lumen/Laravel
I recently changed the way my application connects to my postgresql database to add the
Select distinct name and number from a table and show it to the drop down box, then save how can i do?
I want to select distinct name and number from a table and show it to the drop down box, then save. how can i do?
How to get masklen from model
The model as below to store the ip address in postgres. from django.db import models from netfields import inetaddressfield,
How to let Chroniker update my table in a cronjob?
I have an issue with my postgresql database, i'm running my app in a container. i have a custom command in my django app working minutely, when it
PonyORM many-to-many relationship on defined schema in postgreSQL
I have question regarding ponyorm and many-to-many relationship. i'm using python3.7, ponyorm and postgresql db. setup: i have two schemas
Postgres ECONNREFUSED on Docker Compose with NodeJS
I get an econnrefused when trying to connect to a postgres server in docker from a nodejs app in docker when running both via docker-compose.
JSON stringify and PostgreSQL bigint compliance
I am trying to add bigint support within my library,
could not find driver (SQL: select * from ".." where ".." = user limit 1) , Services 'app' failed to build when run docker-compose build at vscode cli
I'm getting failed when building app 403 forbidden, how can i resolve this? i already search for some solution but isn't works. maybe i get wrong
How to connect Postgresql in Laravel project
I tried to connect postgresql and laravel i can see all data on pgadmin. but i can't connect the postgresql on laravel project please help me
How to change time zome in different tables in Laravel
Can you give an idea? i have two tables in to postgresql db. the are filled with recods by two separate csv files. but the records of the first
Encrypt postgres data using nodejs/sequelize
I've created a public key and stored it in my database. now i'm trying to insert encrypted data that is encrypted using the public key.
Ad
How to append nodejs sequelize model list of json field
How to append a list of json filed in nodejs sequelize database: postgres i have one model field like that
extract quarter from date field and display like Q4:YYYY format in query results
Trouble with formatting using to_char extract (quarter from reviewedon) as quarter returns 4 i need it to display as
How to get value from the second table if it's null in the first one
I have a little issue with a sql query. so. i have three tables: artists, albums and songs.
How to combine 2 tables in query SQL and convert to JSON
I have these tables albums (id integer, name text, year text) songs (id integer, title text, year text, performer text,
Joining Table Laravel Combined with JQuery and AJAX request
I want to join some of tables and getting the data to display into datatables, i'm recently using yajra datatables. here list of tables
Count not null json key->values in postgres table
I have a postgres table with a field requirements (json field). i need to count the not null keys in the json. what would be the best approach?
Why Sequelize migration create table but models can not connect to a database
I am learning how to use sequelize orm in nodejs and save data in postgres database. my goal is to insert user data into
Hashed pass, compare the result
I have a postgres datbase with a node backend. let hash = bcrypt.hashsync("mypass", 10); try { const querystring = `
NodeJS Sequelize: Association with alias [alias] does not exist on [model]
I'm using nodejs & sequelize for a school project and i'm struggling on making associations w/ sequelize work. i tried a couple of things
Update request ManyToMany NestJS
I'm quite new on coding, i am using nestjs to create an app along with postegresql whenever i try to update something i get an error. i
TYPEORM filtering data of a complex JSON
I am retrieving below data from postgres using typeorm and i want to filter this data: [{ "corporateid": 1001, "customerdetail":
Ad
Set new fields' value after database migration in LoopBack 4
Loopback has easy way to deal with database migrations, which differs from the method that uses, for example, knex.js. in the
Failed to loading node_modules in Google Cloud Function (index.js, not on the project root)
So i need to deploy a google cloud function to make a select request on a postgresql database (cloud sql). i need to use the pg module, then i
db-migrate insert data from csv
I need to insert data in to my postgresql via db-migrate for my serverless app. so i have 4 table and each table has it's own csv data. due to the
Sequelize: query to include a parent model's data if it has associated children; don't return the child model's data
In my node.js app using sequelize with a postgresql database i have defined three models: users, baskets, and items. the users model has many
Problem with the connection between postgresql and flutter
So i'm developing a flutter project that interact with postgresql database with dart and i have a problem with the connection between postgresql
How do I fix an "open handles" error in a Jest DB fixtures function?
I'm writing some jest tests for a node/postgres web app. here's the fixtures helper file: /*eslint no-console: ["error",
Postgresql how to group the values in on column of a table and transpose the unique values of another column in the same table, and sum up the rows
I am new to sql in general, hence this problem is a little tricky to me. i have a table like the example below: input values:
SQL query help: total people living in each province
I am using postgresql and windows. i have an sql query issue for which i need some help. the table diagram:
SQL query: choosing only the first word in a column
I am using postgresql and windows. i have column data that looks like this:
Laravel Deployment : PHP Error Unable to load dynamic library 'pdo_pgsql'
I want to deploy my laravel app in ubuntu server 18 lts. so i have install nginx postgres php. but when i try to do php artisan
How to connect a Database to an Angular Web Application?
I want to display and edit data from a existing postgresql database in an angular web application. i am completely new to angular and stuff. i
Ad
Import sql file with template literal variables and execute with knex raw
I have a large sql query that i'd like to move into a .sql file and then import and execute using knex.raw(). so i have
How to use split_part of postgresql inside laravel?
I want to use split_part inside laravel. my code
Possible to add dynamic WHERE clause with a QueryFile?
I have a complex query stored in an sql file and i would like to reuse it for various routes but change up the where clause depending on the
Postgres + NodeJS inserts, but doesn't end the script
I have this script, that consumes a soap xml, makes it a json, and use it to load data on a postgresql db for grafana. on my main script,
Subquery help Postgre
I have 2 tables in my schema: 1 - covid_data (relevant columns: country, year, week, cases). data example:
Postgresql return zero-length delimited error
I am trying to make a connection with postgresql 12 for laravel framework. i use laravel 5.8 version. when i try to login a user by using
How can I update specific value from my JSON type column
I have my web application and i am having statistics about my users in json type column. for example: {'current': {'friends': 5, 'wins': 2,
setting up passport local strategy with postgresSQL
I'm having issues setting up passport authentication with my server. i've used passportjs before but with mongodb. i'm currently trying to setup
Postgres : Complex Multiple Update query for one to many relationship
My db looks like this
How to make sql foreach loop by Laravel Query builder?
I have an array. can i send the values in an array with one query and get a separate response for all arrays ...? $regions:
Laravel 6 PHPUnit Testing - could not find driver (SQL: PRAGMA foreign_keys = ON;)
I'm started to write tests in laravel. my application works, i can login, run migrations, but when i'm trying to test the login, i'm getting the
Ad
"Psycopg2.error column doesn't exist" error when trying to write injection-safe PostgreSQL query on Python
I'm writing a function to dynamically create insert/update/select queries for postgresql database using psycopg2 library. i've been trying
Angular validator to check availability
I'm creating a reactive form in angular to register some devices. in this form i ask for a serial number, and i want to check if this serial
TypeORM array is not supported in postgres?
I have a column kid_ages which is integer[]. when migrating, i get the following error:
Getting results from the asynchronus query in nodejs
I'm extracting some data from the database, to use it in my nodejs app. i'm using node-postgres to connect to the db
Postgres DateTimeField incorrect time
I have in my module datetimefield: class pairs(models.model): id = models.autofield(primary_key=true) timestamp =
Controller reference is not defined node.js application
I'm working on a node.js single-page web application where i wanna use mvc. on my back-end, i'm using postgres database to store data that will be
My API endpoint is not returning the expected output
I have written a backend app with express js to retrieve info from a database through get requests from an api endpoint. the query that i have
"Error": "invalid input value for enum" only when using pg package in application to do INSERT SQL operation
I am beginning to build out the user authentication part of my application and i am using postgresql as my database. i have a table set up in pg
how to get the count of the posts for each month in laravel
I want to make charts in my laravel application and i want to show how many posts was created in each month so i need a sort of api like below
Postgresql JSONB | nested arrays gives ERROR aggregate function calls cannot be nested
So i'm trying to convolute multiple queries and form the result as [ { heading: 'test', subheading:
Postgresql jsonb -> invalid reference to FROM-clause entry for table "mt"
So i'm trying to inner join multiple tables in order to bind jsonb with a name. but i'm getting this error. error: invalid
Ad
How to configure Knex.ts in TypeScript project?
I am trying to configure knexfile in typescript. i created knexfile.ts with knex init -x ts: const
How to sum in a json field that contains an array of objects with Eloquent
[ {"id":4,"sum":19}, {"id":3,"sum":9}, {"id":6,"sum":32}, {"id":2,"sum":32} ] i'm trying this, but it finds
Ad
Blog Categories
Ad