I am trying to write an SQL query with PostgreSQL where I want to DELETE team_member_tag table record no longer presented in the array of $tags. The parameter is found in the tag table. tag table: id slug 3742 first-tag 3743 second-tag team_member_tag table: id team_member_id tag_id 89263 68893 3742 89264 68893 3743 The catch is that I should be
Tag: postgresql
I am always getting an error everytime i try to add data in db: SQLSTATE[42703]: Undefined column: 7 ERROR: column
So, theres already a pre-made table in the database. Now, I am trying to connect my project to that specific table in the db. but everytime i try to insert data, im getting this error “SQLSTATE[42703]: Undefined column: 7 ERROR: column “updated_at” of relation “applicant_account_tbl” does not existnLINE 1: …”, “last_name”, “birthdate”, “email”, “password”, “updated_a…n ^ (SQL: insert into “applicant_account_tbl”
laravel eloquent model record not fetched
I am facing a strange issue. When I do NumberConfiguration::all() I receive the following result: but in the database I have actually 2 record: I didnt find anything what can cause this problem, that not all record are represented by the eloquent model biding. I am using postgresql database. There is an observer in the parent class, but even if
Symfony Command stores an empty SQL-File for Database Backup
i have an issue by making backup from database (Postgresql 11) with Symfony(6.01) Command. I use also for that the Process Bundle of Symfony. Problem is, if the Controller Action calls the command to backup the database, it saves finally an empty SQL-File. There is also no errors in dev.log or Postgreql logfile. But when i print out the command
Prepared statements against a JSON key throwing “must appear in the GROUP BY clause” in PostgreSQL using PDO
I am trying to dynamically group by json keys to find the average answer. This Query works fine when it is ran inside PostgreSQL and I get my expected result: The issue now occurs when I don’t know the keys. They’re dynamically created and thus I need to loop over them. ‘Example’ comes from user input. The JSON is created
Laravel Relationship with integer[] type of postgresql column
I have categories table and products table. in products table have category_id column type of integer[]. ex: {1,2,3} . And I need products list with category relation which categories.id exist products.category_id I tried in model Product: no get category is null. Answer I can’t relation but with attribute i can get categories firstly cast category_id to array and and it
Is having an “id” column in a table mandatory to work with BackPack?
I have a table with columns color_id and list_id. When I load a page with that specific model in Laravel BackPack, it throws an error: In general, this is correct. I do not have an id column since it’s a pivot table. I assumed adding custom sorting would solve the problem so I added the following line in my controller’s
Postgres, get all items from one table which ids are not in another tables JSON array column?
I have two tables: cars table which contains: electric_cars How to select all records from the cars table which are not in the non_valid_cars array of ids in the electric_cars column with id cars_id? Also, I am using Laravel Framework, but I will translate a query into the framework. Thank you so much for your help. Answer You can use
after deployment In Heroku Insert user not working
I made a normal CRUD app with Laravel 8 , it was working fine in my local machine , but when i deployed it on Heroku , and tried to Insert a user it gives me this error : everything else (editing, updating, Deleting) seems to be working just fine it also seem to highlight this ligne in my controller
Query return speed is fine but fetch is very slow
PostgreSQL 14 PHP 7.4 I have a PHP call that returns a handle to a scrollable cursor (PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) with about 760,000 records. The handle is being returned in a reasonable amount of time. However, once I have the handle back, doing nothing but fetching each record in a loop is taking over 12 minutes. I have tried it