Vous n'êtes pas identifié(e).
- Contributions : Récentes | Sans réponse
#1 Re : Général » limitation du nombre de caractères des colonnes,tables,views,fonctions » 22/10/2013 22:52:50
Merci pour vos réponses,
nous utilisons effectivement jenkins, mais pour le moment, on va se contenter de sensibiliser les programmeurs et aussi faire des code review.
#2 Re : Général » limitation du nombre de caractères des colonnes,tables,views,fonctions » 19/10/2013 15:33:32
je sais tout ca, ma question est ce que on peut limiter cela a 30.
#3 Re : Général » limitation du nombre de caractères des colonnes,tables,views,fonctions » 18/10/2013 21:33:35
des objets.
quand tu fais : create table aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
comment faire pour que ça renvoie "character too long" ?
#4 Général » limitation du nombre de caractères des colonnes,tables,views,fonctions » 18/10/2013 17:27:08
- baradji
- Réponses : 9
Salut,
Existe t'il un moyen de limiter les nombres de caractères des colonnes, tables,views et fonctions sur Posgresql pour empêcher les programmeurs de dépasser les 30 caractères lors de la création des colonnes,tables,views et fonctions.
Merci
#5 Général » Outil qui analyse une BD et indique des potentiels lindex à créer » 16/10/2013 14:04:45
- baradji
- Réponses : 1
Salut,
j'aimerais savoir s'il existe un outil qui analyse la base de donnée et indique des potentiels index à créer.
Merci
#6 Re : PL/pgSQL » fonction avec if imbriqués affichant un select » 11/01/2013 07:08:46
salut, ca marche, la requete n'est pas trop optimisé, mais ca pourra aider d'autre presonnes, et si vous aviez une version optimisé, svp, j'attend votre solution:
CREATE OR REPLACE FUNCTION bis_ca_prog_get_adress(
id integer, opostal_address_street character varying,opostal_address_city character varying,opostal_address_state character varying, opostal_address_postcode character varying,
omain_address_street character varying,omain_address_city character varying,omain_address_state character varying, omain_address_postcode character varying,
ipostal_address_street character varying,ipostal_address_city character varying,ipostal_address_state character varying, ipostal_address_postcode character varying,
imain_address_street character varying,imain_address_city character varying,imain_address_state character varying, imain_address_postcode character varying)
RETURNS SETOF address_ind_org_type AS
$BODY$
DECLARE
mon_record address_ind_org_type;
id ALIAS FOR $1;
request_orga int;
request_cont int;
BEGIN
request_orga := contact_organisation_stk_stakeholder_id from ca_programme where ca_programme_id = id;
request_cont := contact_stk_stakeholder_id from ca_programme where ca_programme_id = id;
if request_orga is not null then
if (opostal_address_street !='' or opostal_address_city !='' or opostal_address_state !='' or opostal_address_postcode !='') then
FOR mon_record IN
SELECT case when so2.postal_address_street != '' then so2.postal_address_street else '[INSERT THE STREET AND NUMBER]' end as address_street,
case when so2.postal_address_city != '' then so2.postal_address_city else '[INSERT THE CITY/SUBURB]' end as address_city,
case when so2.postal_address_state != '' then so2.postal_address_state else '[INSERT THE STATE]' end as address_state,
case when so2.postal_address_postcode != '' then so2.postal_address_postcode else '[INSERT THE POSTAL CODE]' end as address_postcode
FROM ca_programme p
LEFT JOIN catalog_table fs ON p.ca_cat_fund = fs.catalog_table_id
LEFT JOIN stk_stakeholder ss2 ON ss2.stk_stakeholder_id = p.contact_stk_stakeholder_id
LEFT JOIN ind_individual i2 ON ss2.individual_id = i2.individual_id
LEFT JOIN vw_stk_stakeholder vs2 ON vs2.stk_stakeholder_id = p.contact_organisation_stk_stakeholder_id
LEFT JOIN stk_organisation so2 ON vs2.stk_organisation_id = so2.stk_organisation_id
left join (
SELECT * FROM cat_currency WHERE currency_country = (SELECT param_value FROM cat_global_params WHERE param_name = 'Country')
) bar on true
WHERE ca_programme_id = id
loop
return next mon_record;
end loop;
elsif (omain_address_street !='' or omain_address_city !='' or omain_address_state !='' or omain_address_postcode !='') then
FOR mon_record IN
SELECT case when so2.main_address_street != '' then so2.main_address_street else '[INSERT THE STREET AND NUMBER]' end as address_street,
case when so2.main_address_city != '' then so2.main_address_city else '[INSERT THE CITY/SUBURB]' end as address_city,
case when so2.main_address_state != '' then so2.main_address_state else '[INSERT THE STATE]' end as address_state,
case when so2.main_address_postcode != '' then so2.main_address_postcode else '[INSERT THE POSTAL CODE]' end as address_postcode
FROM ca_programme p
LEFT JOIN catalog_table fs ON p.ca_cat_fund = fs.catalog_table_id
LEFT JOIN stk_stakeholder ss2 ON ss2.stk_stakeholder_id = p.contact_stk_stakeholder_id
LEFT JOIN ind_individual i2 ON ss2.individual_id = i2.individual_id
LEFT JOIN vw_stk_stakeholder vs2 ON vs2.stk_stakeholder_id = p.contact_organisation_stk_stakeholder_id
LEFT JOIN stk_organisation so2 ON vs2.stk_organisation_id = so2.stk_organisation_id
left join (
SELECT * FROM cat_currency WHERE currency_country = (SELECT param_value FROM cat_global_params WHERE param_name = 'Country')
) bar on true
WHERE ca_programme_id = id
loop
return next mon_record;
end loop;
end if;
elsif (request_orga is null and request_cont is not null) then
if (ipostal_address_street !='' or ipostal_address_city !='' or ipostal_address_state !='' or ipostal_address_postcode !='') then
FOR mon_record IN
SELECT case when i2.postal_address_street != '' then i2.postal_address_street else '[INSERT THE STREET AND NUMBER]' end as address_street,
case when i2.postal_address_city != '' then i2.postal_address_city else '[INSERT THE CITY/SUBURB]' end as address_city,
case when i2.postal_address_state != '' then i2.postal_address_state else '[INSERT THE STATE]' end as address_state,
case when i2.postal_address_postcode != '' then i2.postal_address_postcode else '[INSERT THE POSTAL CODE]' end as address_postcode
FROM ca_programme p
LEFT JOIN catalog_table fs ON p.ca_cat_fund = fs.catalog_table_id
LEFT JOIN stk_stakeholder ss2 ON ss2.stk_stakeholder_id = p.contact_stk_stakeholder_id
LEFT JOIN ind_individual i2 ON ss2.individual_id = i2.individual_id
LEFT JOIN vw_stk_stakeholder vs2 ON vs2.stk_stakeholder_id = p.contact_organisation_stk_stakeholder_id
LEFT JOIN stk_organisation so2 ON vs2.stk_organisation_id = so2.stk_organisation_id
left join (
SELECT * FROM cat_currency WHERE currency_country = (SELECT param_value FROM cat_global_params WHERE param_name = 'Country')
) bar on true
WHERE ca_programme_id = id
loop
return next mon_record;
end loop;
elsif (imain_address_street !='' or imain_address_city !='' or imain_address_state !='' or imain_address_postcode !='') then
FOR mon_record IN
SELECT case when i2.main_address_street != '' then i2.main_address_street else '[INSERT THE STREET AND NUMBER]' end as address_street,
case when i2.main_address_city != '' then i2.main_address_city else '[INSERT THE CITY/SUBURB]' end as address_city,
case when i2.main_address_state != '' then i2.main_address_state else '[INSERT THE STATE]' end as address_state,
case when i2.main_address_postcode != '' then i2.main_address_postcode else '[INSERT THE POSTAL CODE]' end as address_postcode
FROM ca_programme p
LEFT JOIN catalog_table fs ON p.ca_cat_fund = fs.catalog_table_id
LEFT JOIN stk_stakeholder ss2 ON ss2.stk_stakeholder_id = p.contact_stk_stakeholder_id
LEFT JOIN ind_individual i2 ON ss2.individual_id = i2.individual_id
LEFT JOIN vw_stk_stakeholder vs2 ON vs2.stk_stakeholder_id = p.contact_organisation_stk_stakeholder_id
LEFT JOIN stk_organisation so2 ON vs2.stk_organisation_id = so2.stk_organisation_id
left join (
SELECT * FROM cat_currency WHERE currency_country = (SELECT param_value FROM cat_global_params WHERE param_name = 'Country')
) bar on true
WHERE ca_programme_id = id
loop
return next mon_record;
end loop;
end if;
else --if request_cont is null then
FOR mon_record IN
SELECT '[INSERT THE STREET AND NUMBER]' as address_street, '[INSERT THE CITY/SUBURB]' as address_city,'[INSERT THE STATE]' as address_state,
'[INSERT THE POSTAL CODE]' as address_postcode
loop
return next mon_record;
end loop;
end if;
return;
END
$BODY$
LANGUAGE plpgsql STABLE;
ALTER FUNCTION bis_ca_prog_get_adress(
id integer, postal_address_street character varying,postal_address_city character varying,postal_address_state character varying, postal_address_postcode character varying,
main_address_street character varying,main_address_city character varying,main_address_state character varying, main_address_postcode character varying)
OWNER TO postgres;
#7 PL/pgSQL » fonction avec if imbriqués affichant un select » 11/01/2013 04:31:43
- baradji
- Réponses : 1
Bonjour , je m'embrouille depuis de matin avec ma fonction, je souhaite afficher une selection selon des conditions, mais j'ai une erreur :
ERROR: syntax error at end of input
LINE 54: $BODY$
la fonction fonctionne bien sans l'instruction apres else if.
voici la fonction
CREATE OR REPLACE FUNCTION bis_ca_prog_get_adress(
id integer, postal_address_street character varying,postal_address_city character varying,postal_address_state character varying, postal_address_postcode character varying,
main_address_street character varying,main_address_city character varying,main_address_state character varying, main_address_postcode character varying)
RETURNS SETOF address_ind_org_type AS
$BODY$
DECLARE
mon_record address_ind_org_type;
id ALIAS FOR $1;
BEGIN
if (select contact_organisation_stk_stakeholder_id from ca_programme where ca_programme_id = id) is not null then
if (postal_address_street !='' or postal_address_city !='' or postal_address_state !='' or postal_address_postcode !='') then
FOR mon_record IN
SELECT case when so2.postal_address_street != '' then so2.postal_address_street else '[INSERT THE STREET AND NUMBER]' end as address_street,
case when so2.postal_address_city != '' then so2.postal_address_city else '[INSERT THE CITY/SUBURB]' end as address_city,
case when so2.postal_address_state != '' then so2.postal_address_state else '[INSERT THE STATE]' end as address_state,
case when so2.postal_address_postcode != '' then so2.postal_address_postcode else '[INSERT THE POSTAL CODE]' end as address_postcode
FROM ca_programme p
LEFT JOIN catalog_table fs ON p.ca_cat_fund = fs.catalog_table_id
LEFT JOIN stk_stakeholder ss2 ON ss2.stk_stakeholder_id = p.contact_stk_stakeholder_id
LEFT JOIN ind_individual i2 ON ss2.individual_id = i2.individual_id
LEFT JOIN vw_stk_stakeholder vs2 ON vs2.stk_stakeholder_id = p.contact_organisation_stk_stakeholder_id
LEFT JOIN stk_organisation so2 ON vs2.stk_organisation_id = so2.stk_organisation_id
left join (
SELECT * FROM cat_currency WHERE currency_country = (SELECT param_value FROM cat_global_params WHERE param_name = 'Country')
) bar on true
WHERE ca_programme_id = id
loop
return next mon_record;
end loop;
else if (main_address_street !='' or main_address_city !='' or main_address_state !='' or main_address_postcode !='') then
FOR mon_record IN
SELECT case when so2.main_address_street != '' then so2.main_address_street else '[INSERT THE STREET AND NUMBER]' end as address_street,
case when so2.main_address_city != '' then so2.main_address_city else '[INSERT THE CITY/SUBURB]' end as address_city,
case when so2.main_address_state != '' then so2.main_address_state else '[INSERT THE STATE]' end as address_state,
case when so2.main_address_postcode != '' then so2.main_address_postcode else '[INSERT THE POSTAL CODE]' end as address_postcode
FROM ca_programme p
LEFT JOIN catalog_table fs ON p.ca_cat_fund = fs.catalog_table_id
LEFT JOIN stk_stakeholder ss2 ON ss2.stk_stakeholder_id = p.contact_stk_stakeholder_id
LEFT JOIN ind_individual i2 ON ss2.individual_id = i2.individual_id
LEFT JOIN vw_stk_stakeholder vs2 ON vs2.stk_stakeholder_id = p.contact_organisation_stk_stakeholder_id
LEFT JOIN stk_organisation so2 ON vs2.stk_organisation_id = so2.stk_organisation_id
left join (
SELECT * FROM cat_currency WHERE currency_country = (SELECT param_value FROM cat_global_params WHERE param_name = 'Country')
) bar on true
WHERE ca_programme_id = id
loop
return next mon_record;
end loop;
end if;
end if;
return;
END
$BODY$
LANGUAGE plpgsql STABLE;
ALTER FUNCTION bis_ca_prog_get_adress(
id integer, postal_address_street character varying,postal_address_city character varying,postal_address_state character varying, postal_address_postcode character varying,
main_address_street character varying,main_address_city character varying,main_address_state character varying, main_address_postcode character varying)
OWNER TO postgres;
merci pour votre aide
#8 Général » optimisation de requete » 12/12/2012 18:41:03
- baradji
- Réponses : 2
Bonjour,
quelqu'un peut m'aider a reduire ma requete ci dessous?
INSERT INTO stk_organisation_staff_in_charge (stk_organisation_id, staff_in_charge_individual_id) SELECT (SELECT max(stk_organisation_id) FROM stk_organisation), (SELECT individual_id FROM ind_individual WHERE complete_name = TRIM('TEST')
and split_individual_staff =1) WHERE TRIM('TEST') != '' AND (SELECT individual_id FROM ind_individual WHERE complete_name = TRIM('TEST') and split_individual_staff =1) != NULL;
surtout je souhaite eviter d'ecrire 2 fois la requete
SELECT individual_id FROM ind_individual WHERE complete_name = TRIM('TEST') and split_individual_staff =1
Merci
#9 Re : Général » Probleme insertion de champs vide dans une colonne date » 12/12/2012 18:15:39
OUF, finalement j'ai casté et ca marche avec ca
INSERT INTO organisation(excel_unique_id,last_audited)
VALUES (1,(SELECT CASE when TRIM('') = '' THEN ('now'::text)::date ELSE (TRIM('')::text)::date END));
merci
#10 Général » Probleme insertion de champs vide dans une colonne date » 11/12/2012 22:55:37
- baradji
- Réponses : 3
Bonjour,
j'importe des données de excel vers postgresql,
j'aio fait un controle qui lorsque le champs last_audited n'est pas renseigné, on insert la date actuel, sinon on recupere la valeur du champs.
INSERT INTO organisation(excel_unique_id,last_audited)
VALUES (1,CASE WHEN TRIM('') = '' THEN (select now()::date) ELSE ''::date END);
mais j'ai une rerreur lorsque je lance la reqeute
ERROR: invalid input syntax for type date: ""
********** Error **********
ERROR: invalid input syntax for type date: ""
SQL state: 22007
quelquun a t'il une idée?
#11 Re : Optimisation » Analyseur de logs pgFouine » 21/11/2012 03:29:17
super,
ca marche bien.
Merci encore rjuju
#12 Re : Optimisation » Analyseur de logs pgFouine » 20/11/2012 18:31:25
Salut,
apres avoir installer strawberry perl, et télécharger pgbadger,
j'ai lancé l'outil perl(commande line) de strawberry.
et ensuite
C:\>cd pgbadger-master
C:\pgbadger-master>Makefile.PL
Cheicking if your kit is complete...
Writing Makefile for pgBadger
Writing MYMETA.yml and MYMETA.json
C:\pgbadger-master>Makefile
'Makefile' n'est pas reconnu en tant que commande interne ou externe,.......
Jai lu le readme sur https://github.com/dalibo/pgbadger
mais je ne vois pas comment générer les rapports.
MErci
#13 Re : Optimisation » Analyseur de logs pgFouine » 19/11/2012 22:10:28
Bonjour,
je suis heureux de retrouver le forum postgresql apres 7 mois d'absence.
j'ai regardé l'install de pgfoune(http://pgfouine.projects.pgfoundry.org/tutorial.html),
mais je ne vois que la procedure d'installation sur linux.
les autres outils proposé par Gleu ne fonctionnent aussi que sur linux.
pourriez vous m’éclairer pour une installation sur windows 7.
merci
#14 Migration » Migration postgresql 8.4.11 vers 9.0 ou 9.1? » 05/04/2012 20:41:01
- baradji
- Réponses : 1
Salut,
Il est temps que je bascule notre gros serveur dédié hébergeant postgresql-8.4.11.
config:
-heberge sur ubuntu
-occupation disque: 46 Go
-a_directory = '/postgres_db/pg-8.4/main'
Je souhaite avoir des conseils sur la version a migrer entre 9.0 et 9.1.
aussi pour la migration, je souhaite avoir votre avis sur cette procédure
-pg_dumpall > sauvegarde.sql
/etc/init.d/postgresql-8.4 stop
mv /postgres_db/pg-8.4 /postgres_db/pg-8.4.old
-installer la nouvelle version en utilisant un autre port (l'ancienne utilisant le port 5432), je garde l'ancienne au cas ou.
$ sudo apt-get install postgresql-9.0 postgresql-client-9.0 postgresql-contrib-9.0
initdb -D /postgres_db/pg-8.4
postgres -D /postgres_db/pg-8.4
restaurer les données: psql -f sauvegarde.sql postgres
Merci
#15 Re : Général » could not receive data from client: Connection timed out » 23/03/2012 16:18:35
mais a quoi cela peut etre du, je vous envois une bonne partie du log
<12345 - 2012-03-22 19:54:55 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<12345 - 2012-03-22 19:54:55 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<12339 - 2012-03-22 19:55:06 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<12339 - 2012-03-22 19:55:06 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<24181 - 2012-03-22 19:56:51 EDT -209.xxx.xx.220> SELECTLOG: duration: 3028.592 ms execute S_3: SELECT addresses.address_id, addresses.street_address, addresses.city, addresses.province, addresses.country, addresses.is_correct FROM address.mappoint_address addresses WHERE addresses.latitude_wgs84 = $1 AND addresses.longitude_wgs84 = $2
<24181 - 2012-03-22 19:56:51 EDT -209.xxx.xx.220> SELECTDETAIL: parameters: $1 = '45.2864', $2 = '-74.0365'
<12319 - 2012-03-22 19:57:48 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<12319 - 2012-03-22 19:57:48 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<11583 - 2012-03-22 20:00:03 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<11583 - 2012-03-22 20:00:03 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<24194 - 2012-03-22 20:00:14 EDT -209.xxx.xx.220> SELECTLOG: duration: 3654.631 ms execute S_2: SELECT addresses.address_id, addresses.street_address, addresses.city, addresses.province, addresses.country, addresses.is_correct FROM address.mappoint_address addresses WHERE addresses.latitude_wgs84 = $1 AND addresses.longitude_wgs84 = $2
<24194 - 2012-03-22 20:00:14 EDT -209.xxx.xx.220> SELECTDETAIL: parameters: $1 = '45.2862', $2 = '-74.0373'
<24181 - 2012-03-22 20:00:15 EDT -209.xxx.xx.220> SELECTLOG: duration: 3705.581 ms execute S_3: SELECT addresses.address_id, addresses.street_address, addresses.city, addresses.province, addresses.country, addresses.is_correct FROM address.mappoint_address addresses WHERE addresses.latitude_wgs84 = $1 AND addresses.longitude_wgs84 = $2
<24181 - 2012-03-22 20:00:15 EDT -209.xxx.xx.220> SELECTDETAIL: parameters: $1 = '45.4876', $2 = '-75.6424'
<11582 - 2012-03-22 20:00:24 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<11582 - 2012-03-22 20:00:24 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<11581 - 2012-03-22 20:00:30 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<11581 - 2012-03-22 20:00:30 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<11579 - 2012-03-22 20:00:30 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<11579 - 2012-03-22 20:00:30 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<11580 - 2012-03-22 20:00:30 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<11580 - 2012-03-22 20:00:30 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<11578 - 2012-03-22 20:01:10 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<11578 - 2012-03-22 20:01:10 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<25097 - 2012-03-22 20:01:26 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<25097 - 2012-03-22 20:01:26 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<1247 - 2012-03-22 20:01:27 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<1247 - 2012-03-22 20:01:27 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<14812 - 2012-03-22 20:01:40 EDT -209.xxx.xx.216> idleLOG: could not receive data from client: Connection timed out
<14812 - 2012-03-22 20:01:40 EDT -209.xxx.xx.216> idleLOG: unexpected EOF on client connection
<11577 - 2012-03-22 20:01:54 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<11577 - 2012-03-22 20:01:54 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<11658 - 2012-03-22 20:01:55 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<11658 - 2012-03-22 20:01:55 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<11677 - 2012-03-22 20:01:56 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<11677 - 2012-03-22 20:01:56 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<12304 - 2012-03-22 20:01:56 EDT -209.xxx.xx.220> idleLOG: could not receive data from client: Connection timed out
<12304 - 2012-03-22 20:01:56 EDT -209.xxx.xx.220> idleLOG: unexpected EOF on client connection
<24194 - 2012-03-22 20:02:35 EDT -209.xxx.xx.220> SELECTLOG: duration: 3159.124 ms execute S_2: SELECT addresses.address_id, addresses.street_address, addresses.city, addresses.province, addresses.country, addresses.is_correct FROM address.mappoint_address addresses WHERE addresses.latitude_wgs84 = $1 AND addresses.longitude_wgs84 = $2
<24194 - 2012-03-22 20:02:35 EDT -209.xxx.xx.220> SELECTDETAIL: parameters: $1 = '48.2664', $2 = '-70.8745'
#16 Re : Général » could not receive data from client: Connection timed out » 23/03/2012 15:45:28
Salut,
Il me semble que le problème ne vient pas forcement de la car hier on a constaté une lenteur du serveur vers 19h, et j'ai vu dans les logs une 20taine de ce message de suite provenant de notre serveur web.
je pense que ce doit être le paramètre max-connexions qui a été dépassé par le nombre de connexion.
je vais augmenter ce paramètre de 100 a 150.
qu'est ce que tu en penses?
#17 Re : Général » could not receive data from client: Connection timed out » 21/03/2012 22:03:24
Merci, effectivement, c'est dû aux ruptures de mes connexion ssh sur mon serveur.
merci
#18 Général » could not receive data from client: Connection timed out » 21/03/2012 17:47:58
- baradji
- Réponses : 6
Salut,
J'ai remarqué dans mes logs ces erreurs qui datent depuis un certains moment.
<1167 - 2012-03-15 17:17:56 EDT - 10.8.0.14> idleLOG: could not receive data from client: Connection timed out
<1167 - 2012-03-15 17:17:56 EDT - 10.8.0.14> idleLOG: unexpected EOF on client connection
pourtant le réseau 10.8.0.0 est autorisé dans le fichier pg_hba.conf
aviez vous une idée?
Merci
#19 Re : Installation » Probleme de demarage de la bd apres aptitude safe-upgrade » 09/03/2012 19:09:56
Lorsque je remet mon ancien fichier postgresql.conf original, j'arrive a demarer le serveur,mais quand je remets l'ancien avec les modif, ca refuse, donc je vais voir dans ce fichier ce qui bloque.
#20 Installation » Probleme de demarage de la bd apres aptitude safe-upgrade » 09/03/2012 18:36:48
- baradji
- Réponses : 2
Salut,
j'avais un serveur postgresql en dev 8.4.10 et hier j'ai lancé la commande aptitude safe-upgrade pour recuperer les derniere mise a jour de ubuntu, et j'ai mise a jour postgresql 8.4.11,
ca fonctionnais hier, mais aujourd'hui, j'ai essaye d'arrter le serveur:impossible,
j'ai fais un kill -9 sur le processus du serveur qui etait a 24143,
mais je n'arrive pas a relancer avec sudo /etc/init.d/postgresql-8.4 start
j'ai l'erreur suivant
* The PostgreSQL server failed to start. Please check the log output.
[fail]
et dans le fichier log, j'ai le message suivant
<26497 - 2012-03-09 11:10:03 EST -> LOG: 00000: database system was interrupted; last known up at 2012-03-09 09:42:57 EST
<26497 - 2012-03-09 11:10:03 EST -> LOCATION: StartupXLOG, xlog.c:5278
<26497 - 2012-03-09 11:10:03 EST -> LOG: 00000: invalid magic number 0000 in log file 463, segment 176, offset 0
<26497 - 2012-03-09 11:10:03 EST -> LOCATION: ValidXLOGHeader, xlog.c:3792
<26497 - 2012-03-09 11:10:03 EST -> LOG: 00000: invalid primary checkpoint record
<26497 - 2012-03-09 11:10:03 EST -> LOCATION: ReadCheckpointRecord, xlog.c:6066
<26497 - 2012-03-09 11:10:03 EST -> LOG: 00000: invalid magic number 0000 in log file 463, segment 176, offset 0
<26497 - 2012-03-09 11:10:03 EST -> LOCATION: ValidXLOGHeader, xlog.c:3792
<26497 - 2012-03-09 11:10:03 EST -> LOG: 00000: invalid secondary checkpoint record
<26497 - 2012-03-09 11:10:03 EST -> LOCATION: ReadCheckpointRecord, xlog.c:6070
<26497 - 2012-03-09 11:10:03 EST -> PANIC: XX000: could not locate a valid checkpoint record
<26497 - 2012-03-09 11:10:03 EST -> LOCATION: StartupXLOG, xlog.c:5387
<26495 - 2012-03-09 11:10:03 EST -> LOG: 00000: startup process (PID 26497) was terminated by signal 6: Aborted
<26495 - 2012-03-09 11:10:03 EST -> LOCATION: LogChildExit, postmaster.c:2745
<26495 - 2012-03-09 11:10:03 EST -> LOG: 00000: aborting startup due to startup process failure
<26495 - 2012-03-09 11:10:03 EST -> LOCATION: reaper, postmaster.c:2266
#21 Re : Installation » ERROR:xlog flush request xxx is not satisfied --- flushed only to ... » 28/02/2012 22:12:57
c'est bizarre,
j'ai stopper la bd, puis relancé ma commande rsync(rsync -e ssh -avz /postgres_db/pg-8.4/main/pg_tblspc/16392/16394/18434 user@xxx.xxx.x.x:/postgres_db/pg-8.4/main/pg_tblspc/16392/16394/)
et relancé le serveur depuis 1h, plus de message d'erreur.
Donc, je pense que c'est le fait que je n'avais pas arrêté mes 2 serveurs avant le rsync que j'avais eu ce problème.
bon, j'attend de faire d'autre manip pour voir encore
#22 Installation » ERROR:xlog flush request xxx is not satisfied --- flushed only to ... » 28/02/2012 21:08:09
- baradji
- Réponses : 4
Salut,
Suite a une nouvelle installation de postgresql-8.4.10 sur un nouveau serveur ubuntu,
J'ai fais un rsync pour copier le repertoire data( /postgresql_db/) de l'encien serveur(postgresql-8.4.8) vers le nouveau,
tout marche bien aparamment, sauf que j'ai dans le fichier log ce message d'erreur sur plusieurs lignes qui se repete
<16561 - 2012-02-28 11:38:53 EST -> ERROR: xlog flush request 1C9/FED02350 is not satisfied --- flushed only to 1C9/FE58E418
<16561 - 2012-02-28 11:38:54 EST -> ERROR: xlog flush request 1C9/FED02350 is not satisfied --- flushed only to 1C9/FE58E418
<16561 - 2012-02-28 11:38:54 EST -> WARNING: could not write block 2 of pg_tblspc/16392/16394/18434
quelqu'un a une idee ?
#23 Re : Optimisation » valeurs des variables de postgresql.conf et /etc/sysctl.conf » 27/02/2012 22:18:52
salut,
environ 60 connexions simultanées.
bcp d’écritures a la seconde.
j'ai vu dans un la documentation postgresql(http://docs.postgresql.fr/8.4/runtime-config-resource.html), qu'il faut allouer 40% de la memoire a la variable shared_buffer.
est ce la memoire totale ou memoire free?
aussi quelle valeure donnees a shmmax et shmall ?
merci
#24 Optimisation » valeurs des variables de postgresql.conf et /etc/sysctl.conf » 27/02/2012 19:21:57
- baradji
- Réponses : 8
Bonjour, j'ai un nouveau serveur dédié postgresql-8.4 installe sur ubuntu.
voici les paramètres
# free
total used free shared buffers cached
Mem: 6117392 4239636 1877756 0 112308 3796344
-/+ buffers/cache: 330984 5786408
Swap: 2000052 76 1999976
-----
# df -h /*
Filesystem Size Used Avail Use% Mounted on
/dev/sda7 546G 42G 477G 8% /
/dev/sda1 183M 22M 152M 13% /boot
none 3.0G 220K 3.0G 1% /dev
-------------
le répertoire data de la bd est actuellement a 42 Go.
Ma préoccupation est de donner les meilleurs valeurs aux variables shared_buffers et autres.
sur l’ancien serveur, voici les valeurs qui existent:
shared_buffers = 1024MB
temp_buffers = 10MB
#max_prepared_transactions = 5
effective_cache_size = 3000MB
work_mem = 30MB
maintenance_work_mem = 16MB
et dans le fichier /etc/sysctl.conf, on
kernel.shmmax=4907034880
kernel.shmall=40971520
net.ipv6.conf.all.disable_ipv6 = 1
or sur le nouveau serveur, ces variables sont inexistant
Quel sera votre conseil pour parametrer postgresql.conf et /etc/sysctl.conf ?
#25 Re : Installation » Cloner l'image de l'encien serveur de bd vers un nouveau serveur de bd » 21/02/2012 22:57:43
salut,
Il s'agit du même FAI, on a demandé une machine ubuntu plus puissante qui a été livré.
techniquement, est ce que c'est possible de récupérer l'image virtuelle de ce serveur sur le nouveau serveur ubuntu?
si oui, comment on peut le faire?
je précise que l’ancien serveur a deux bd postgresql plus un bd mysql et auusi des taches cront. et aussi on a plusieurs clients java, web-service et php qui utilisent l’ancien serveur.
sinon, en passant par rsync, est ce que la copie de tous les répertoires liés a postgresql de l’ancien serveur vers le nouveau peut me garantir que la bd va bien fonctionner sur le nouveau?
Merci