Postgres Upsert On Conflict Where Clause

A basic example of a Postgres Upsert using “on conflict do update” with a where clause.    Postgres Upsert ON CONFLICT with WHERE clause create table z_test( f1 text PRIMARY KEY, f2 text, f3 text, f4 text ); insert into z_test (f1,f2,f3,f4)...

Django Views

Each Django view is responsible for doing one of two things: returning an HttpResponse object containing the content for the requested page, or raising an exception such as Http404. The rest is up to you. Your view can read records from a database, or not. It can use...

Django Tutorial – models, database, admin

Code / Syntax stuff from the tutorial that I’m definitely going to forget, so putting it here for easy reference: Question.objects.all() Question.objects.filter(id=1) Question.objects.filter(question_text__startswith=’What’) q =...

Setup FTP Server on Debian using VSFTP

vsftpd, is an FTP server for Unix-like systems, including Linux. To get vsftpd up and running, do the following as root.    Bash Script apt-get install vsftpd ftp systemctl restart vsftpd.service cd /etc vi vsftpd.conf uncomment local_enable = YES That...

Pin It on Pinterest