Forcing a fresh start with Postgres after updating major version

On my Manjaro machine, I updated packages, and Postgres got updated to version 13.2-1.

Before the update, I had some databases on the previous version. Now Postgres won’t start because it recognises that the existing databases are from the old version. When I attempt to start Postgres, I get:

~|⇒ sudo systemctl status postgresql ● postgresql.service - PostgreSQL database server      Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)      Active: failed (Result: exit-code) since Fri 2021-03-12 21:30:02 GMT; 2min 53s ago     Process: 3173 ExecStartPre=/usr/bin/postgresql-check-db-dir $  {PGROOT}/data (code=exited, status=1/FAILURE)  Mar 12 21:30:01 xps systemd[1]: Starting PostgreSQL database server... Mar 12 21:30:02 xps postgres[3173]: An old version of the database format was found. Mar 12 21:30:02 xps postgres[3173]: See https://wiki.archlinux.org/index.php/PostgreSQL#Upgrading_PostgreSQL Mar 12 21:30:02 xps systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE Mar 12 21:30:02 xps systemd[1]: postgresql.service: Failed with result 'exit-code'. Mar 12 21:30:02 xps systemd[1]: Failed to start PostgreSQL database server. 

Those databases weren’t important. They were for my personal pet projects and I’m happy to delete them.

How do I do that? Postgres won’t start, so I can’t delete them through psql. How can I force the latest version to start afresh? Ignore or delete the existing databases.

Updating options of a widget with own tool

I am writing a tool to update the options of a self-created widget outside the backend "Appearance – Widgets" page. These are simple yes/no options in the widget.

It seems to work as I am using get_option(optionName) and update_option(optionName, optionValue) but I am confused.

Here is a display of a portion of the options table in WP.

Text

I can perfectly fetch and update the gcs_xxxx parameters but what is this "widget_golf_course_status" option record? It seems it doesn’t have any effect on the output/visualisation of the widget.

When I update the widget options through APPEARANCE – WIDGETS

  • widget_golf_course_status is updated with new values
  • the gcs_xxxx parameters are updated to correct values

When I update the widget options through my own tool (custom page) with get_option() and update_option()

  • widget_golf_course_status record is NOT updated with new values
  • the gcs_xxxx parameters are updated to correct values

Anyway the output looks OK in both cases.

Questions

  1. Do I need to update the widget_golf_course_status when updating options with my own tool? It seems to have no effect on output if it’s not in sync with gcs_xxx options.
  2. Why is this needed? What is it used for?
  3. Do I better just work on ‘widget_golf_course_status’ record and it will auto-update the other records?

Server quit without updating PID file when trying to start MySQL server?

So I created my .bash_profile, opened it in a text editor and added:

export PATH=$  PATH:/usr/local/mysql/bin 

and then I saved it. Next, I tried running

sudo /usr/local/mysql/support-files/mysql.server start 

was told to enter my password (so I did), and then terminal said

Starting MySQL  

and then it kept printing dots until it said:

ERROR! The server quit without updating PID file (/usr/local/mysql/data/Nicks-MacBook-Pro.local.pid). 

The error logs look like:

2021-01-25T20:50:49.707062Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.23) starting as process 15092 2021-01-25T20:50:49.710232Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive 2021-01-25T20:50:49.834599Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2021-01-25T20:50:49.943719Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2021-01-25T20:50:50.037810Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock 2021-01-25T20:50:50.125494Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2021-01-25T20:50:50.126128Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2021-01-25T20:50:50.151069Z 0 [System] [MY-010931] [Server] /usr/local/mysql/bin/mysqld: ready for connections. Version: '8.0.23'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server - GPL. ~ ~ ~ ~ ~ (END) 

How do I fix this?

conversion failed when converting datetime from character string while inserting and updating to database

I’m trying to insert time and date separately and calculate if it is late to the set time and then insert it to database…

here’s my try code for update

string Date = DateTime.Now.ToString("dd-MM-yyyy"); string Time = DateTime.Now.ToString("h:mm:ss tt"); SqlCommand comm2 = conn.CreateCommand(); comm2.CommandText = "Update Time_Logs SET Time_Out = ‘" + Time + "’ where Emp_Id = ‘" + EmpId.Text + "’ and Date = ‘" + Date + "’"; try { conn.Open(); comm2.ExecuteNonQuery(); MessageBox.Show("Time_Out…"); conn.Close(); TimeCompute(); } catch (Exception x) { MessageBox.Show(x.Message); conn.Close(); }

and here is the code for inserting

string Date = DateTime.Now.ToString("dd-MM-yyyy"); string Time = DateTime.Now.ToString("h:mm:ss tt");

        SqlCommand comm = conn.CreateCommand();         comm.CommandText = "INSERT INTO Time_Logs (Emp_Id, Date, Time_In) VALUES('" + EmpId.Text + "','" + Date + "','" + Time + "')";         try         {             conn.Open();             comm.ExecuteNonQuery();             MessageBox.Show("Time_In...");             conn.Close();             DateTime time = DateTime.Parse(Time);             DateTime inDate = DateTime.Parse("8:00:00 AM");             TimeSpan ts1 = inDate.TimeOfDay;             TimeSpan ts = time - inDate;             if (ts < ts1)             {                 SqlCommand comm2 = conn.CreateCommand();                 comm2.CommandText = "Update Time_Logs SET Late = '" + ts + "' where Emp_Id = '" + EmpId.Text + "' and Date = '" + Date + "'";                 conn.Open();                 comm2.ExecuteNonQuery();                 conn.Close();             }             else             {                 SqlCommand comm2 = conn.CreateCommand();                 comm2.CommandText = "Update Time_Logs SET Late = '" + ts + "' where Emp_Id = '" + EmpId.Text + "' and Date = '00:00:00'";                 conn.Open();                 comm2.ExecuteNonQuery();                 conn.Close();             }         }         catch (Exception x)         {             MessageBox.Show(x.Message);             conn.Close();         } 

Premium Perfume Business For Sale Amazon eBay Affiliate Auto Updating Website

This is the perfect Website for beginners wanting to create an online income with a blog and affiliate store combo. Everything is set up for you and ready to go!

Ready to Start A New Hassle-free Online Income? Then Read On!

PerfumeOnline.store is a stunning affiliate blog + store built using WordPress and the Intelligent Fresh Store System. It is fully loaded with Amazon and eBay products and is ready to go.

No maintenance needed – everything is…

Premium Perfume Business For Sale Amazon eBay Affiliate Auto Updating Website

Questions on updating statistics and index maintenance jobs

Since my question Index and statistics optimization scripts duration and log bloat problem. Looking for good strategy? has been closed because it was not focused enough I’ve three questions:

For statistics and index optimization I want to use Ola Hallengreens scripts.

  1. If I update statistics only or rebuild/reorganize indexes: Is there anyting dangerous by cancelling the job right in the middle of it if I see logfile becomes too big or the job takes too long and slows down daily work?

If not there is nothing I need to worry about and I can run it maybe on any evening or on a saturday and watch how it works and cancel it with no problem if some of the mentioned problems occur. Is this true?

  1. If I use Olas script configured like this (no offline index rebuild):
  • FragmentationLevel1 = 50%
  • FragmentationLevel2 = 80%
  • FragmentationMedium = ‘INDEX_REORGANIZE,INDEX_REBUILD_ONLINE’
  • FragmentationHigh = ‘INDEX_REBUILD_ONLINE’
  • @UpdateStatistics nvarchar(max) = ‘ALL’,
  • @OnlyModifiedStatistics nvarchar(max) = ‘Y’,

Can I use this safely during worktime when people are working on the database?

  1. Is there any dangerous by doing such maintenance jobs (statistics update/index rebuild/index reorganize) which could damage the database if I use Ola with those parameters? The only thing I’ve seen where growing a large log file. Or can I install this with no worries and if anything occurs just cancel it (see question 1)?

Godot / GDscript label text not updating every frame like intended

I am very new to Godot and coding in general, so I apologize in advance for any simple mistakes. I am trying to have my text display the variable "ammodisplay" on my object "Marine." When I launch the game, the text sets to 7 (the correct value) but as I play the game and the variable changes, the text does not update with it. Any insight as to how I can fix this? Thanks in advance!

extends Label  var NODE = load("Marine.tscn") var ammo = NODE.instance() var ammod = ammo.ammodisplay   func _process(delta):     text = (str(ammod)) ``` 

Widget disappeared after updating widget_text directly in the wp_options table

I wanted to fix a typo in one of my widgets. I found that the following row in the wp_options table contains the text with the typo. I updated the option_value column with the fix but now, the widget has completely disappeared from the screen.

option_id, option_name, option_value, autoload 83,widget_text,"a:3:{i:2;a:3:{s:5:"title";s:16:"Location";s:4:"text";s:89:"Address";s:6:"filter";b:0;}i:3;a:3:{s:5:"title";s:0:"";s:4:"text";s:334:"<div class="attribution-text">Copyright text</div>";s:6:"filter";b:0;}s:12:"_multiwidget";i:1;}",yes 

I deleted the above row and refreshed the screen (to see if the old values come back), and now it has created this new row in the table

option_id, option_name, option_value, autoload '100000000000007', 'widget_text', 'a:1:{s:12:\"_multiwidget\";i:1;}', 'yes' 

Can someone help me bring back the widget’s text?

Note: I am looking to update entries directly in the database because the Appearance–> Customize got broken after a PHP version upgrade and can’t be accessed for a few days.