Re: [GENERAL] How to typecast an integer into a timestamp?
On Fri, Jan 27, 2012 at 08:17:37AM -0800, Adrian Klaver wrote: Did some digging. php-mktime returns the Unix epoch (seconds since January 1 1970 00:00:00 GMT) indeed, didn't get it that postgres timestamp wasn't the same Postgres has a function(to_timestamp) that will convert that to a timestamp: http://www.postgresql.org/docs/9.0/interactive/functions-formatting.html to_timestamp(double precision)timestamp with time zoneconvert Unix epoch to time stamp to_timestamp(1284352323) So something like the below in your query should work: to_timestamp(int_returned_from_php) very neat that does it! thanks a lot everybody! ciao Bruno -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] help... lost database after upgrade from 9.0 to 9.1
On Wed, Jan 04, 2012 at 10:06:53AM -0800, Adrian Klaver wrote: Hello! So when you are running pg_ctlcluster 9.0 main start what user are you running as? tried as root... Have you tried to directly start the 9.0 cluster as the postgres user?: just tried, same error postgres@agenda:~$ pg_ctlcluster 9.0 main startError: could not exec start -D /var/lib/postgresql/9.0/main -l /var/log/postgresql/postgresql-9.0-main.log -s -o -c config_file=/etc/postgresql/9.0/main/postgresql.conf : usr/lib/postgresql/9.0/bin/pg_ctl /usr/lib/postgresql/9.0/bin/pg_ctl start -D\ /var/lib/postgresql/9.0/main\ -l /var/log/postgresql/postgresql-9.0-main.log -s -o -c\ config_file=/etc/postgresql/9.0/main/postgresql.conf Get the 9.0 server running. ok, got it, from your lines i saw that the binaries of the server were removed so i copied them over from the other server, and got the server running! pfo.. thanks a lot! any suggestion how to keep informed about dying disks? (as you might have guessed, i am only a dev playing sys-admin...) -- ciao bboett == bbo...@adlp.org http://inforezo.u-strasbg.fr/~bboett/ === -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
[GENERAL] help... lost database after upgrade from 9.0 to 9.1
Hello! just made a stupid move... upgraded a working system and without checking if the backup was ok so i end up with a debian system having upgraded to 9,1 without converting the database, and a scrambled backup which is totally unusable i tried to start the old tree with pg_ctlcluster 9.0 main start Error: could not exec start -D /var/lib/postgresql/9.0/main -l /var/log/postgresql/postgresql-9.0-main.log -s -o -c config_file=/etc/postgresql/9.0/main/postgresql.conf : so i tried to copy the old 9.0 tree to a machine with a still working 9,0 postgres, but it stops with Starting PostgreSQL 9.0 database server: mainError: could not exec /usr/lib/postgresql/9.0/bin/pg_ctl /usr/lib/postgresql/9.0/bin/pg_ctl start -D /var/lib/postgresql/9.0/main -l /var/log/postgresql/postgresql-9.0-main.log -s -o -c config_file=/etc/postgresql/9.0/main/postgresql.conf : ... failed! failed! so what can i do to extract the data of that tree and feed it into the 9.1 tree? thanks in avance! -- ciao bboett == bbo...@adlp.org http://inforezo.u-strasbg.fr/~bboett/ === -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
[GENERAL] Problem setting up a user and a Db...
Hello, seems a stupid problem, but somehow i am not able to solve it i want to set up an environment identical to one on another server, thus i need a user and db which match the ones on the production server and the whole thing with password identification... so i tried the following: createuser -d -l -P -R -S rahhar createdb -O rahhar -U rahhar -W m4rr6 in the pg_hba i have a line hostall all 127.0.0.1/32md5 the creatuser passes fine, asks me for the password, but the createdb fails with an ident error and now i am clueless about what's going wrong... -- ciao bboett == bbo...@adlp.org http://bboett.free.fr -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general