Re: [GENERAL] Corrupted Dabatabase

2016-06-27 Thread Pau Marc Muñoz Torres
hello again

 to cancel the execution of the \di i used cntl+c, the output for the cat
 /proc/mounts returns

/dev/mapper/ddf1_4c534920202020201055471147111e78p1 /home
ext3 rw,data=ordered 0 0

i when i say i was indexing a table, i mean that i was executing a "create
index"  command

p

Pau Marc Muñoz Torres
skype: pau_marc
http://www.linkedin.com/in/paumarc
http://www.researchgate.net/profile/Pau_Marc_Torres3/info/


2016-06-27 16:21 GMT+02:00 Sterpu Victor :

> You probably have a HDD problem.
> Try a "cat /proc/mounts" and see if partition is mounted read only.
>
> -- Original Message --
> From: "Pau Marc Muñoz Torres" 
> To: "pgsql general" 
> Sent: 27/6/2016 4:28:35 PM
> Subject: [GENERAL] Corrupted Dabatabase
>
>
> Hello Everydody,
>
>  My database is corrupted, each time i try to list all the tables in the
> database  i have got the following message
>
> hla2db=> \d
> ERROR:  could not open relation 1663/16385/1255: Read-only file system
>
> I read that my best option is to use my backup. Before using my backup i
> would like to remove all databases in postgresql and create everything
> again from scratch. Unfortunatlly i can't see the list of databases,
> althought i am able to create databse
>
>
>
>  can you suggest what to do? is it a good idea to reinstall postgresql?
>
>
> Pau Marc Muñoz Torres
> skype: pau_marc
> http://www.linkedin.com/in/paumarc
> http://www.researchgate.net/profile/Pau_Marc_Torres3/info/
>
>


Re: [GENERAL] Corrupted Dabatabase

2016-06-27 Thread Pau Marc Muñoz Torres
hi

 thank you for your quick answer,


 I  am working with linux. here you have the output of uname --all



Linux XXX at 2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:13:52 EDT 2011 x86_64
x86_64 x86_64 GNU/Linux

And the filesystem is ext3

 i was able to work with the database until last week when i was indexing
the database. the problem came when i tried to cancel a \di command

 as far as i know nothing  changed since the last time  i was working last
week.

p


Pau Marc Muñoz Torres
skype: pau_marc
http://www.linkedin.com/in/paumarc
http://www.researchgate.net/profile/Pau_Marc_Torres3/info/


2016-06-27 15:38 GMT+02:00 Alex Ignatov :

>
> On 27.06.2016 16:28, Pau Marc Muñoz Torres wrote:
>
> Hello Everydody,
>
>  My database is corrupted, each time i try to list all the tables in the
> database  i have got the following message
>
> hla2db=> \d
> ERROR:  could not open relation 1663/16385/1255: Read-only file system
>
> I read that my best option is to use my backup. Before using my backup i
> would like to remove all databases in postgresql and create everything
> again from scratch. Unfortunatlly i can't see the list of databases,
> althought i am able to create databse
>
>
>
>  can you suggest what to do? is it a good idea to reinstall postgresql?
>
>
> Pau Marc Muñoz Torres
> skype: pau_marc
> http://www.linkedin.com/in/paumarc
> http://www.researchgate.net/profile/Pau_Marc_Torres3/info/
>
>
> May be you filesystem is mounted read-only after power loss or some OS
> crash?
>
> What OS do you have   - WIndows or some kind of Unix (Linux,  etc). Also
> what  file system  Postgresql data dir is using?
>
> Alex Ignatov
> Postgres Professional: http://www.postgrespro.com
> The Russian Postgres Company
>
>
>


[GENERAL] Corrupted Dabatabase

2016-06-27 Thread Pau Marc Muñoz Torres
Hello Everydody,

 My database is corrupted, each time i try to list all the tables in the
database  i have got the following message

hla2db=> \d
ERROR:  could not open relation 1663/16385/1255: Read-only file system

I read that my best option is to use my backup. Before using my backup i
would like to remove all databases in postgresql and create everything
again from scratch. Unfortunatlly i can't see the list of databases,
althought i am able to create databse



 can you suggest what to do? is it a good idea to reinstall postgresql?


Pau Marc Muñoz Torres
skype: pau_marc
http://www.linkedin.com/in/paumarc
http://www.researchgate.net/profile/Pau_Marc_Torres3/info/


Re: [GENERAL] conditional insert

2011-09-05 Thread Pau Marc Muñoz Torres
Ok , thanks Sim, now i see it

P

2011/9/5 Sim Zacks 

> **
> On 09/05/2011 01:37 PM, Pau Marc Muñoz Torres wrote:
>
> i don't  see it clear, let me put an example
>
> i got the following table
>
> molec varchar(30)
> seq varchar(100)
>
> where I insert my values
>
>  lets image that i have a record introduced as ('ubq', 'aadgylpittrs')
>
> how i can prevent to insert another record where molec='ubq' ?
>
> thanks
>
>  Either put a unique constraint on molec or do
> insert into tbl(molec,seq)
> select 'ubq', 'aadgylpittrs' where not exists(select molec from tbl where
> molec='ubq')
>



-- 
*Pau Marc Muñoz Torres*

Laboratori de Biologia Computacional
Institut de  Biotecnologia   i Biomedicina Vicent Villar

Universitat Autonoma de Barcelona
E-08193 Bellaterra (Barcelona)

telèfon:  (+34)935 86 89 39*
Email : paumarc.mu...@bioinf.uab.cat*


Re: [GENERAL] conditional insert

2011-09-05 Thread Pau Marc Muñoz Torres
i don't  see it clear, let me put an example

i got the following table

molec varchar(30)
seq varchar(100)

where I insert my values

 lets image that i have a record introduced as ('ubq', 'aadgylpittrs')

how i can prevent to insert another record where molec='ubq' ?

thanks



2011/9/5 Thomas Kellerer 

> Pau Marc Muñoz Torres, 05.09.2011 11:38:
>
>  Hi follk
>>
>>  i trying  to performe a  conditional insert into a table, indeed, what
>> i'm trying to do is not insert a record into the table if that record exist
>>
>> googleling i found something like
>>
>>  insert into XX values (1,2,3) where not exist (select );
>>
>> but i'm having and error near where...
>> anyone knows how do i can perfome this insert?
>>
>
> INSERT INTO xxx
> SELECT 1,2,3
> WHERE NOT EXISTS (SELECT ...)
>
> Regards
> Thomas
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-general<http://www.postgresql.org/mailpref/pgsql-general>
>



-- 
*Pau Marc Muñoz Torres*

Laboratori de Biologia Computacional
Institut de  Biotecnologia   i Biomedicina Vicent Villar

Universitat Autonoma de Barcelona
E-08193 Bellaterra (Barcelona)

telèfon:  (+34)935 86 89 39*
Email : paumarc.mu...@bioinf.uab.cat*


[GENERAL] conditional insert

2011-09-05 Thread Pau Marc Muñoz Torres
Hi follk

 i trying  to performe a  conditional insert into a table, indeed, what i'm
trying to do is not insert a record into the table if that record exist

googleling i found something like

 insert into XX values (1,2,3) where not exist (select );

but i'm having and error near where...

anyone knows how do i can perfome this insert?

thanks

p