Faustas - Programming, Projects, Psychology and Faust
If you want to convert an integer value into a timestamp in Postgres, you can use the following function:
SELECT to_timestamp(1321398000);
The vice versa conversion can be done with the following line:
select extract(epoch from '2011-11-15 00:00:00+01'::timestamp with time zone)::integer
If you want to check the schema or the content of your tables (e.g. in your Sqlite db) in your rails application, you can use the following rails command to start the rails console:
rails dbconsole
The following command shows the available instructions:
.help
If you want to see the available tables:
.tables