Re: [GENERAL] Import Schema converting tinyint to Boolean?

2016-01-21 Thread Félix GERZAGUET
On Thu, Jan 21, 2016 at 9:52 AM, Guyren Howe  wrote:

> I'm converting a MySQL database to a Postgres database by doing a bunch of
> CREATE TABLE… AS SELECT * FROM, but the tinyints are coming across as
> tinyints.
>
> Seems like there ought to be an option somewhere to have them behave like
> Booleans but I can't see it.
>

For that part of your question, maybe you could adapt the method described
here:
http://adpgtech.blogspot.fr/2016/01/using-postgresql-95s-import-foreign.html

Félix


Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread Félix GERZAGUET
Hello Chris,

On Mon, Dec 28, 2015 at 8:10 PM, Christopher Molnar <
cmol...@ourworldservices.com> wrote:

> Any suggestions?
>
This seems to works:

select regexp_replace('Complete the attached lab and submit via
dropbox\rhttps://owncloud.porterchester.edu/HVACR/PCI_GasHeat/GasElectrical/HVACR1114_LAB_13A.pdf;
title="Lab 13A">Lab 13A<\a>', '/([^/]*)\" title=', '/=\1" title=')

Regards,

Félix


Re: [GENERAL] Test disk reliability (or HGST HTS721010A9E630 surprisingly reliable)

2015-12-21 Thread Félix GERZAGUET
On Mon, Dec 21, 2015 at 12:31 AM, Jim Nasby <jim.na...@bluetreble.com>
wrote:

> On 12/20/15 1:09 PM, Félix GERZAGUET wrote:
>
>> After reading
>> http://www.postgresql.org/docs/current/static/wal-reliability.html, I
>> tried the recommended diskchecker.pl
>> <http://brad.livejournal.com/2116715.html> but I am not satisfied:
>>
>> I always get:
>> Total errors: 0
>>
>> even if I tested with with a HGST HTS721010A9E630 that the vendor's
>> datasheet
>> (http://www.hgst.com/sites/default/files/resources/TS7K1000_ds.pdf)
>> advertise as "
>> Designed for low duty cycle, non mission-critical applications in
>> PC,nearline and consumer electronics environments, which vary
>> application to application
>> "
>>
>> Since it is not, a high end disk, I expect some errors.
>>
>
> Why? Just because a disk isn't enterprise-grade doesn't mean it has to lie
> about fsync, which is the only thing diskchecker.pl tests for.
>

I was thinking that since the disk have a 32M write-cache (with not
battery) it would lie to the OS (and postgres) about when data are really
on disk (not in the disk write cache). But maybe that thinking was wrong.


[GENERAL] Test disk reliability (or HGST HTS721010A9E630 surprisingly reliable)

2015-12-20 Thread Félix GERZAGUET
Hello,

I am trying to assess disk reliability.
After reading
http://www.postgresql.org/docs/current/static/wal-reliability.html, I tried
the recommended diskchecker.pl 
but I am not satisfied:

I always get:
Total errors: 0

even if I tested with with a HGST HTS721010A9E630 that the vendor's
datasheet (http://www.hgst.com/sites/default/files/resources/TS7K1000_ds.pdf)
advertise as "
Designed for low duty cycle, non mission-critical applications in
PC,nearline and consumer electronics environments, which vary application
to application
"

Since it is not, a high end disk, I expect some errors.

Here is my methodology:

On another machine: disckchecker.pl -l
On the tested machine: disckchecker.pl -s IP_OF_OTHER_MACHINE create
test_file 500
Perform an electrical reboot of the tested machine (the web application of
my hosting service warn me that my application will not be properly stopped)
On the tested machine: disckchecker.pl -s IP_OF_OTHER_MACHINE verify
test_file
[...]
Total errors: 0

I re-did the test 5 times. The tested machine is a real machine, not a VM.

Could you please correct me, If am doing something wrong, or give me some
pointers to some other methods.

Félix