Sunday, December 28, 2014

Quitter, Non-smoker and Ex-smoker

Earlier today on Quitline,  Axl231261 and g1nny posed the question "When do we go from Ex Smoker to Non-Smoker?"

I'm not sure that it is a progression. Quitting is a process at the end of which you've become an ex-smoker. Being a non-smoker can also be interpreted as a function state .. one who does not smoke.  If I'm not smoking, I'm a non-smoker. If I'd never smoked I would be a non-smoker. If I'd given up 20 years ago I'd be a non-smoker. If I gave up yesterday I'd still be a non-smoker:
Time QuitEx smokerQuitterNon-smoker
Never smokedNNY
Still smokeNYN
1 day?Y?
100 daysYY?

Most of the table cells make sense, but the question marks are the ones where interpretation is required. Personally I'd say the ? marks should be replaced (left to right) by N, N, Y even though that second N contradicts the previous paragraph. Redefine "Non-smoker" purely functionally as "Non-smoking smoker" and I'd agree with the Y.

I'm still trying to work through going from "Quitting" to "Ex-Smoker". While I wasn't smoking and getting by with Champix, a chemical aid, I was definitely a Quitter. Since then I've been a couple of months not smoking without any chemical assists. Functionally a non-smoker during that time, but with internal turmoil that makes me wonder about my commitment to the process.

The way I model it for myself is that I'm a nicotine / tobacco smoking addict and basically I'm like any other Addict. I happen to be clean and I can usually tell you how many days clean. I have acquired methods and techniques that help me avoid smoking and I have a support network that helps me stay clean. But, beyond all this I am an addict. I am a non-smoking tobacco addict, I don't think I'm really an ex-smoker yet and don't think I have any right to describe myself as that until I realise I go days in a row without thinking about smoking.

That's what I'll say to my fellow quitters. For the last 15 years I've worked with a guy that gave up before I met him. He's told me that he found describing himself as a non-smoker rather than an ex-smoker had one big advantage for him; people didn't offer him cigarettes in the way that they did when he said he was an ex-smoker. I don't know if the 21st century differs greatly from the 20th in this respect, but when talking to a non-quitter that doesn't know me as a smoker I describe myself as a non-smoker and would decline an offered cigarette with a polite "No thanks, I don't"

Upgrading Postgres to 9.4 beta3

I've been running Debian testing for quite a while and have recently had an error when attempting to update my Postgresql database
The on-disk format of the PostgreSQL 9.4 data files has changed between
beta2 and beta3 (and as a consequence, the catalog version number). For that
reason, existing PostgreSQL 9.4 clusters need to be dumped using the old
package version, and reloaded after upgrading the packages.

The postgresql-9.4 package will now refuse to upgrade because version 9.4
clusters exist on the system.

Per default, a "main" cluster is created. Run "pg_lsclusters" to check if
other clusters exists, and repeat the steps below appropriately.

To resolve the situation, before upgrading, execute:
# su - postgres
$ pg_lsclusters
$ pg_ctlcluster 9.4 main start
$ pg_dumpall --cluster 9.4/main | gzip > 9.4-main.dump.gz
$ cp -a /etc/postgresql/9.4/main 9.4-main.config
$ pg_dropcluster 9.4 main --stop

Then after the upgrade, execute:
# su - postgres
$ pg_createcluster 9.4 main
$ cp 9.4-main.config/* /etc/postgresql/9.4/main
$ pg_ctlcluster 9.4 main start
$ zcat 9.4-main.dump.gz | psql -q --cluster 9.4/main
$ rm -rf 9.4-main.config 9.4-main.dump.gz
So I did this :) only to get the following message on the zcat | psql step
ERROR:  role "postgres" already exists

Googling for the error message gave the suggestion that I should use the command dropuser postgres, but that just produced the message
dropuser: removal of role "postgres" failed: ERROR:  current user cannot be dropped

At this point I tried a little poking around and close to the top of the dump file I discovered the line
CREATE ROLE postgres;
A quick test of dropping the CREATE ROLE line worked first time. This meant that the zcat line now reads
zcat 9.4-main.dump.gz | grep -v 'CREATE ROLE postgres'|psql -q --cluster 9.4/main

With this change the upgrade's worked without obvious errors and psql is responding to simple queries. Unfortunately I don't know enough about postgres to be able to say that everything is working.