[GENERAL] How to detect Postgres deadlocks?

2006-08-23 Thread andre
, but I 'd like to know how to get those procpids, and how to get the "current_query" associated with them...Thank you in advance, Andre Philippi

[GENERAL] configure PostgreSQL with the python: distutils module not found

2016-10-20 Thread Andre Mikulec
n 5 2016, 16:11:51) [MSC v.1800 64 bit (AMD64)] on w 32 Type "help", "copyright", "credits" or "license" for more information. >>> import distutils >>> Please help. Thank you. Andre Mikulec andre_miku...@hotmail.com

[GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

2016-10-20 Thread Andre Mikulec
is ."? I do not know what to do next. Please help. Thank you, Andre Mikulec andre_miku...@hotmail.com

[GENERAL] make PostgreSQL with TCLSH: No rule to make target

2016-10-20 Thread Andre Mikulec
c/pl/tcl' make[2]: *** [all-tcl-recurse] Error 2 make[2]: Leaving directory `/c/postgres-master_0ab9c56_debug/src/pl' make[1]: *** [all-pl-recurse] Error 2 make[1]: Leaving directory `/c/postgres-master_0ab9c56_debug/src' make: *** [all-src-recurse] Error 2 I do not know what to do next. Please help. Thank you, Andre Mikulec andre_miku...@hotmail.com

Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

2016-10-20 Thread Andre Mikulec
Tom, I m getting this. TargetUser@TARGETMACH ~ $ perl -v This is perl, v5.8.8 built for msys-64int 5.8.8 is not right. See later emails. Andre Mikulec andre_miku...@hotmail.com From: Tom Lane Sent: Thursday, October 20, 2016 9:54 AM To: Andre Mikulec Cc

Re: [GENERAL] configure PostgreSQL with the python: distutils module not found

2016-10-20 Thread Andre Mikulec
Adrian, I am sorry. I am not trying to use the Language Packs, to build my own custom version of a Language. I mispoke myself. Thanks, Andre Mikulec andre_miku...@hotmail.com From: Adrian Klaver Sent: Thursday, October 20, 2016 9:58 AM To: Andre Mikulec

Re: [GENERAL] configure PostgreSQL with the python: distutils module not found

2016-10-20 Thread Andre Mikulec
postgresql.org/docs/9.5/static/plpython-funcs.html Last, I did a very simple test. postgres=# select pymax(5,3); pymax --- 5 (1 row) Thanks, Andre Mikulec andre_miku...@hotmail.com From: Tom Lane Sent: Thursday, October 20, 2016 10:03 AM To: A

Re: [GENERAL] make PostgreSQL with TCLSH: No rule to make target

2016-10-23 Thread Andre Mikulec
$ if {$1 > $2} {return $1} return $2 $$ LANGUAGE pltcl STRICT; select tcl_max(5,3); postgres=# select tcl_max(5,3); tcl_max - 5 (1 row) Thanks, Andre Mikulec andre_miku...@hotmail.com ____ From: Tom Lane Sent: Thursday, October 20, 2016 10:18

Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

2016-10-23 Thread Andre Mikulec
src\interfaces\libpq/fe-misc.c:603: undefined reference to `win32_htonl' collect2.exe: error: ld returned 1 exit status make[3]: *** [libpq.dll] Error 1 make[3]: Leaving directory `/c/postgres-master_0ab9c56_debug/src/interfaces/libpq' make[2]: *** [all-libpq-recurse] Error 2 make

Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

2016-10-24 Thread Andre Mikulec
Never mind. I figured it out. Soon, I will write up a summary. Andre Mikulec andre_miku...@hotmail.com From: Adrian Klaver Sent: Sunday, October 23, 2016 7:18 PM To: Andre Mikulec; pgsql-general@postgresql.org Cc: Tom Lane Subject: Re: [GENERAL] configure

Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

2016-10-24 Thread Andre Mikulec
Never mind. I figured it out. Soon I will write up a summary. Andre Mikulec andre_miku...@hotmail.com From: Andre Mikulec Sent: Sunday, October 23, 2016 7:05 PM To: pgsql-general@postgresql.org Cc: Tom Lane Subject: Re: [GENERAL] configure PostgreSQL with

Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

2016-10-24 Thread Andre Mikulec
May strait answer is true. 1. I need to change the width of all of my tables because I have very wide data. There is a compile-time parameter for that. 2. I need to debug, compile and install a modified version of the PostgreSQL extension pl/r. Andre Mikulec andre_miku...@hotmail.com

[GENERAL] Solution: On Windows with Mingw, how to Install PostgreSQL with zlib, pltcl, plperl, and plpython

2016-10-30 Thread Andre Mikulec
more powerful Language distributions ( other than the ones that were mentioned earlier ) Activestate TCL ACTIVETCL COMMUNITY EDITION DOWNLOAD http://www.activestate.com/activetcl/downloads Strawberry Perl http://strawberryperl.com/ WinPython https://winpython.github.io/ Andre Mikulec andre_miku...@hotmail.com

[GENERAL] PostgreSQL on a CompactFlash

2008-01-31 Thread Andre Nieder
some stored on the cf. If we change a table in memory, will PosgreSQL access the cf? As you know a cf card has not an unlimited amount of accesses... So is there any reason that should prevent us from using PostgreSQL in combination with a compact flash? Andre

[GENERAL] Tools for form generation in PHP/HTML from database models/queries

2010-10-22 Thread Andre Lopes
Hi, I need to do some repetitive work in form creation to insert, update and delete data from the database. There are some tools that handle with form creation from a PostgreSQL database? PS: Sorry my English. Best Regards,

[GENERAL] It is possible to update more than 1 table in the same update statement?

2010-11-07 Thread Andre Lopes
Hi, I need to update various tables in the same update. It is possible to do it? Best Regards,

Re: [GENERAL] It is possible to update more than 1 table in the same update statement?

2010-11-07 Thread Andre Lopes
ible? It is the best way to do it? Best Regards, On Sun, Nov 7, 2010 at 3:11 PM, Scott Ribe wrote: > On Nov 7, 2010, at 7:58 AM, Andre Lopes wrote: > > > need to update various tables in the same update. It is possible to do > it? > > Transactions??? > > -- > Scott Ri

Re: [GENERAL] It is possible to update more than 1 table in the same update statement?

2010-11-07 Thread Andre Lopes
The only way I can guarantee a transaction is in a Function or there are other ways? Best Regards, On Sun, Nov 7, 2010 at 3:22 PM, Szymon Guz wrote: > > > On 7 November 2010 16:20, Andre Lopes wrote: > >> Sorry for not explain well. >> >> I mean update more t

Re: [GENERAL] It is possible to update more than 1 table in the same update statement?

2010-11-08 Thread Andre Lopes
terno', '38', /* id_anuncio_externo */ '2010-08-31', /* data_inicio */ '2010-12-29', /* data_fim */ 'AA' /* Motivo: Aprovação Anúncio */ ); commit; [/code] Best Regards, On Sun, Nov 7, 2010 at 3:41 PM, Scott Ribe wrote: > On Nov 7, 201

[GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread Andre Lopes
Hi, I need to obtain the maximum value of a date, but that comparison will be made between 3 tables... I will explain better with a query... [code] select a.last_refresh_date as d1, ae.last_refresh_date as d2, ha.last_refresh_date as d3 from tbl1 a join tbl2 ae on a.id_anuncio_externo = ae.id_anu

Re: [GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread Andre Lopes
2010 at 1:20 PM, Jon Nelson > wrote: > On Wed, Dec 8, 2010 at 7:15 AM, Andre Lopes > wrote: > > Hi, > > > > I need to obtain the maximum value of a date, but that comparison will be > > made between 3 tables... I will explain better with a query... > > >

[GENERAL] How to deal with field on the database that stores variable array's?

2011-01-01 Thread Andre Lopes
Hi, I need to develop a database table that will aceept a variable array field. My doubt is how to deal with updates on the array field. How can I store the information of the array fields? There any examples on the Internet on how to deal with this subject? What I mean with variable array is:

[GENERAL] Need advise for database structure for non linear data.

2011-01-03 Thread Andre Lopes
Hi, I need advise about a database structure. I need to capture data from the web about one specific subject on few specific websites and insert that data to a database. I have done this question here before, but I think I have not explained very well. The problem with this task is that the infor

Re: [GENERAL] Need advise for database structure for non linear data.

2011-01-03 Thread Andre Lopes
Hi, Thanks for the reply's. I was tempted to accept the Rodoslaw Smogura proposal. There will be about 100 websites to capture data on daily basis. Each website adds per day(average) 2 articles. Thomas talked about the noSQL possibility. What do you think would be better? I have no experience in

[GENERAL] Store base64 in database. Use bytea or text?

2011-01-25 Thread Andre Lopes
Hi, I need to put some images on Base64 in a PostgreSQL database. Wich type should I use and what is the difference between using bytea or text to store Base64? Best Regards, -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.p

Re: [GENERAL] Store base64 in database. Use bytea or text?

2011-01-25 Thread Andre Lopes
. Best Regards, On Tue, Jan 25, 2011 at 10:46 PM, Bill Moran wrote: > In response to Peter Geoghegan : > >> On 25 January 2011 22:27, Andre Lopes wrote: >> > Hi, >> > >> > I need to put some images on Base64 in a PostgreSQL database. Wich >> > type

Re: [GENERAL] Store base64 in database. Use bytea or text?

2011-01-25 Thread Andre Lopes
, On Tue, Jan 25, 2011 at 10:58 PM, Dmitriy Igrishin wrote: > > > 2011/1/26 Andre Lopes >> >> Thanks for all the reply's. >> >> I will be using PHP for now to insert data. >> >> So I shouldn't use base64 to store images or any other kind of f

Re: [GENERAL] Store base64 in database. Use bytea or text?

2011-01-28 Thread Andre Lopes
to Dmitriy Igrishin : > >> 2011/1/26 Andre Lopes >> >> > Thanks for the reply. >> > >> > I will mainly store files with 100kb to 250kb not bigger than this. >> > >> > PQescapeByteaConn is not available in a default installation of >

[GENERAL] Database Design - Which design should I use? Two options.

2011-02-05 Thread Andre Lopes
Hi, I'm designing a database, but I'm with some doubts in the design. I have posted a question in stackoverflow because of the use of images. Can someone give some clues about which design should I use? The link to the question is here: http://stackoverflow.com/questions/4909105/database-design-

[GENERAL] Slow Inserts, two different scenarios.

2011-02-07 Thread Andre Lopes
Hi, I have a problem when doing INSERT's in a table. The table structure is: uri (varchar 1) PK id_language (varchar 10) PK id_category (int4) PK id_data (varchar 50) PK id_ordinal (int4) PK (this field have a trigger to auto increment) n_text (text) When I run this function to do 90 IN

Re: [GENERAL] Schema version control

2011-02-11 Thread Andre Lopes
Hi, Where can we donwload dbsteward? Best Regards, On Fri, Feb 11, 2011 at 5:16 AM, Bill Moran wrote: > In response to Glenn Maynard : > >> On Thu, Feb 10, 2011 at 6:44 PM, Bill Moran wrote: >> >> > dbsteward can do downgrades ... you just feed it the old schema and >> > the new schema in rev

[GENERAL] Transactions and ID's generated by triggers

2011-02-27 Thread Andre Lopes
Hi, I have a situation that I dont know how to deal. I have 2 tables "tdir_uris_files" and "tdir_uri_files_details". Please see the Image in attach. The table "tdir_uris_files" have the field "id_ordinal" that is originated by a trigger(before insert) The table "tdir_uri_files_details" use the f

Re: [GENERAL] Transactions and ID's generated by triggers

2011-02-28 Thread Andre Lopes
that you need. > > David J. > > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Andre Lopes > Sent: Sunday, February 27, 2011 3:34 PM > To: postgresql Forums > Subject: [GENERAL] Transactions

Re: [GENERAL] Transactions and ID's generated by triggers

2011-02-28 Thread Andre Lopes
Hi, Thanks for the reply. How can I user the RETURNING without pl/sql? My PostgreSQL version is 8.3 Can you give me some example? Best Regards, On Mon, Feb 28, 2011 at 7:00 PM, Alban Hertroys wrote: > On 28 Feb 2011, at 24:37, David Johnston wrote: > >> Using pl/pgsql you can: > > You don'

[GENERAL] PHP array to PlPgSQL arrat. How to?

2011-03-05 Thread Andre Lopes
Hi, I need to transform an PHP array to an PlPgSQL array. The PHP array is like this: [quote] $arr = array( 0 => array( "base64" => "ddfff", "image_t

Re: [GENERAL] PHP array to PlPgSQL arrat. How to?

2011-03-05 Thread Andre Lopes
string_to_array function > > SELECT func(string_to_array('1,2,3,4,5',',')); > > Regards > > Pavel Stehule > > > 2011/3/5 Andre Lopes : >> Hi, >> >> I need to transform an PHP array to an PlPgSQL array. The P

Re: [GENERAL] PHP array to PlPgSQL arrat. How to?

2011-03-05 Thread Andre Lopes
Thanks again, I saw this tutorial on how to get Key => Value, http://justatheory.com/computers/databases/postgresql/key-value-pairs.html It is not possible to use hstore to me. Best Regards, On Sat, Mar 5, 2011 at 7:42 PM, Pavel Stehule wrote: > 2011/3/5 Andre Lopes : >&

Re: [GENERAL] PHP array to PlPgSQL arrat. How to?

2011-03-06 Thread Andre Lopes
,html_width_height,mime} NOTICE: values: {jpg,343,515,"width=\"343\" height=\"515\"",image/jpeg} Best Regards, On Sat, Mar 5, 2011 at 10:44 PM, John R Pierce wrote: > On 03/05/11 11:22 AM, Andre Lopes wrote: >> >> Hi, >> >> I need to transform a

Re: [GENERAL] PHP array to PlPgSQL arrat. How to?

2011-03-06 Thread Andre Lopes
; > for one dimensional arrays - select array_upper(var,1) - array_lower(var,1) > > Regards > > Pavel Stehule > > 2011/3/6 Andre Lopes : >> Hi, >> >> Just another question about this subject. >> >> It is possible to compare if these 3 PlpgSQL arrays ha

[GENERAL] Using bytea field...

2011-03-08 Thread Andre Lopes
Hi, I'm using a bytea field to store small images in base64. I need to know if I can compare bytea rows for equality. To know for example if the file already exists in the database, this is possible with bytea? Best Regads, -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) T

[GENERAL] Some PostgreSQL enthusiast working in holland?

2011-04-04 Thread Andre Lopes
Hi, I'm willing to contact a PostgreSQL developer working in Holland. I know that this is not the main reason of this list. Please contact-me by e-mail. Best Regards, -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgres

[GENERAL] Select rotate in PostgreSql

2013-03-13 Thread Andre Lopes
Hi all, I don't know how to ask for this. I need to rotate a Select in PostgreSql, just like this: http://dpaste.com/1021691/ I can achieve this easily without a procedure? Best Regards, -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription

[GENERAL] trying to program in PostgreSQL C a statistics function

2017-06-11 Thread Andre Mikulec
--- However in my case, I have this adjustement "case when measure > 0.00 then 0.00 else measure end" So the case seems that I need access to 'X' but access to sumX and sumX2 are only shown. How would I get accress to X? May anyone point me to a simple good work

[GENERAL] https://www.postgresql.org/ftp/source/v10.0/ distribution IS different than git tag REL_10_0

2017-10-08 Thread Andre Mikulec
.bz2 different (and not compile ) compared to the git tag REL_10_0 distribution that does compile? Thanks, Andre Mikulec andre_miku...@hotmail.com

[GENERAL] Postgres Plus Advanced Server and general Postgres compatibility?

2009-07-05 Thread Andre Lopes
Hi, I have installed "Postgres Plus Advanced Server" in a developement machine. TAt this time I don't know the production server envoirement. It is problematic to use "Postgres Plus Advanced Server" as developement server? Could I have some compatibility problems? Best Regards, André.

[GENERAL] Best practices to WorkFlow design?

2009-07-10 Thread Andre Lopes
Hi, I will be developing a WorkFlow Application, but I don't know the best practices on how to design a WorkFlow on a Database. Can you give me some clues? Books, links on the Internet, etc... Best Regards, André.

[GENERAL] Can't execute function

2009-07-30 Thread Andre Lopes
Hi. I need to know what is wrong with this function [code] CREATE OR REPLACE FUNCTION "public"."apr_alta_empregado" ("pID_SOCIEDADE" varchar, "pID_EMPREGADO" varchar, "pNOME" varchar, "pNOME_ABREV" varchar, "pDAT_NASC" date, "pLOCALIDADE_NASC" varchar, "pID_TIPO_BILHETE_IDENTIFICACAO" varchar, "pB

[GENERAL] How to make an INSERT INTO to a view?

2009-07-30 Thread Andre Lopes
Hi, I'am new to PostGre... I need to insert to a view. For security measures the users will be only able to insert to views. How can I do that? INSERT INTO a view in PostGreSQL Best Regards, André.

[GENERAL] Design Database, 3 degrees of Users.

2009-07-31 Thread Andre Lopes
I need to design a Database that will handle 3 degrees of users: Administrators - They can see all the information in the database. Managers - They only can see the information of his dependants. Dependants - Theirs action must be aprovet by the managers. Wich the best way to implement this i

[GENERAL] plpgsql function to validate e-mail

2009-08-16 Thread Andre Lopes
Hi, I need a plpgsql function to validade e-mail addresses. I have google but I can't find any. My question: Anyone have a function to validate e-mails? Best Regards, André.

[GENERAL] There are procedures in Postgres 8.3?

2009-08-18 Thread Andre Lopes
Hi, I have some functions developed in postgres to work as a procedure. But now I see in the Postgres Studio that we have the option to create a procedure... So my question? there are procedures in Postgres 8.3? If yes, what the correct syntax to write procedures in Postgres 8.3? Best Regards, An

[GENERAL] Postgre RAISE NOTICE and PHP

2009-08-18 Thread Andre Lopes
Hi, I'm developing a function with some checks, for example... to check if the e-mail is valid or not. If the e-mail is not valid I put a line with RAISE NOTICE 'E-mail not valid'. I need to know if it is possible to show this RAISE NOTICE when I run this function from PHP. Best Regards, André

[GENERAL] Access Control System - Design

2009-08-18 Thread Andre Lopes
Hi, I need to implement a "Access Control System", but I don't have any clue of what it is the ideal system... I will try to explain my problem... I have 4 levels of users in my web application, "Super Administrator", "Administrator", "Manager" and "Worker". The database have data from more than

[GENERAL] Wich the best way to control the logic of a web application?

2009-08-19 Thread Andre Lopes
Hi, Now I'am with some doubts on how to control the logic of a web application? So... the web application uses PHP, object oriented and PostgresSQL Database. I have developed some procedures and functions in the database but I don't know if it is correct to mix logic in the database and PHP. Wha

[GENERAL] Convert DECIMAL MySql field to PostGre. How?

2009-10-11 Thread Andre Lopes
Hi, I have designed a database using MySql, but now I decided to move to PostGre. I hava decimal fields with DECIMAL(10,6). How to convert this fields to PostGre? Best Regards, André.

[GENERAL] tar error while running basebackup

2009-10-13 Thread Andre Brandt
occurs - or do I have an error in reasoning? best regards, Andre -- 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] tar error while running basebackup

2009-10-13 Thread Andre Brandt
How can this happen? I always thought, that, when in backup mode, nothing is able to change the database - so the database files shouldn't change. Can autovaccumdb cause the changes? pg_start_backup() doesn't tell the database to stop writing changes to disk; it essentially just says "

[GENERAL] How to deactivate FK's to reorder fields in table?

2009-10-13 Thread Andre Lopes
Hi, I need to reorder fields in one table. But the database don't let me do this action because the FK's pointing to the table. How can I deactivate the FK's? Best Regards, André.

[GENERAL] Free Tool to design Postgres Databases

2009-10-19 Thread Andre Lopes
Hi, I'am searching for a free tool to design a Postgre Database. There is something similar to MySQL Workbench? Best Regards, Andre.

[GENERAL] Store images on database ou in external files?

2009-11-01 Thread Andre Lopes
Hi, I need to choose a way to store image files. This database will take care of an Add Classifieds website with low ammount of Ads, maximum of 20 new ads per month. It is good idea for this kind of website to store image files in the database? Another question... How to do inserts by the comma

[GENERAL] Inspecting a DB - psql or system tables ?

2011-05-27 Thread Andre Majorel
Suppose you want to write a program that connects to a PostgreSQL database and lists its tables and views, the type of their columns and their relationships (REFERENCES) for automatic joins. Would you look at the system tables (pg_class et al.) or the output of psql \d, \dt, etc ? While parsing t

[GENERAL] SQLite-PostgreSQL comparison

2011-06-05 Thread Andre Majorel
Does anyone know of a document comparing SQLite and PostgreSQL ? Thanks in advance. -- André Majorel http://www.teaser.fr/~amajorel/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] How to install PGCRYPTO in PostgreSQL9

2011-08-17 Thread Andre Lopes
Hi, I am using CentOS and PostgreSQL9. I have an application that uses Pgcrypto. I have googled but I am not sure how can I install this in PostgreSQL9. Someone can give me a clue on this? Best Regards, -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to yo

Re: [GENERAL] How to install PGCRYPTO in PostgreSQL9

2011-08-17 Thread Andre Lopes
I have installed and tried to import the SQL, but I got this: [code] [andre@andre public]$ psql -d 420 -f /usr/pgsql-9.0/share/contrib/pgcrypto.sql SET psql:/usr/pgsql-9.0/share/contrib/pgcrypto.sql:9: ERROR: permission denied for language c psql:/usr/pgsql-9.0/share/contrib/pgcrypto.sql:14

Re: [GENERAL] How to install PGCRYPTO in PostgreSQL9

2011-08-17 Thread Andre Lopes
Thanks for the reply. I have installed with the user "postgres" and it worked. Thanks! 2011/8/17 Adrian Klaver : > On Wednesday, August 17, 2011 6:44:31 am Andre Lopes wrote: >> I have installed and tried to import the SQL, but I got this: >> >> [code] >>

[GENERAL] How to correct: ERROR: permission denied: "RI_ConstraintTrigger_24966" is a system trigger

2011-10-18 Thread Andre Lopes
Hi, I have created a database that have a function that disable triggers on tables, but when I execute the function: (I have created the database with the same user that I'm trying to execute the function) [code] select triggerall(false); [/code] return [code] ERROR: permission denied: "RI_Con

Re: [GENERAL] How to correct: ERROR: permission denied: "RI_ConstraintTrigger_24966" is a system trigger

2011-10-18 Thread Andre Lopes
his? Best Regards, On Tue, Oct 18, 2011 at 9:08 AM, Craig Ringer wrote: > On 10/18/2011 03:52 PM, Andre Lopes wrote: >> >> Hi, >> >> I have created a database that have a function that disable triggers >> on tables, but when I execute the function: (I have created

[GENERAL] How to get faster queries in the database?

2012-09-09 Thread Andre Lopes
Hi, I've developed a system that was not to work online, but now it is online and it is degrading due to bad design choices. Here is the thing. I've the database build in "vertical mode". I will justo explain what I mean with that. Attribute | Value site_name | Some site name1 uri

[GENERAL] How to call a file from a PlPgsql trigger?

2010-04-19 Thread Andre Lopes
Hi, I have an account in a shared hosting account and I can't install any 3rd party software. I need to send data from a PostgreSQL database to a MySQL database. I was thinking of using a trigger. The trigger calling a PHP file to help me passing the data to the MySQL database. It is possible to

Re: [GENERAL] How to call a file from a PlPgsql trigger?

2010-04-19 Thread Andre Lopes
Hi, Thanks for the reply. I can't install languages. The database is in a shared hosting. There are other solutions? Best Regards, On Mon, Apr 19, 2010 at 10:00 AM, Pavel Stehule wrote: > Hello > > 2010/4/19 Andre Lopes : > > Hi, > > > > I have an account i

Re: [GENERAL] How to call a file from a PlPgsql trigger?

2010-04-19 Thread Andre Lopes
Ok, So the best option is to send the data to a table and then with an cronjob I verify if it is data to send to the MySQL database. Best Regards, André. On Mon, Apr 19, 2010 at 10:09 AM, Pavel Stehule wrote: > 2010/4/19 Andre Lopes : > > Hi, > > > > Thanks for the r

[GENERAL] Database viewpoint of subject - Sending e-mails from database table with Cronjob

2010-04-21 Thread Andre Lopes
Hi, I need some advice about a subject. I generate e-mail messages to a database table and then with a CronJob I sent the e-mails. My doubt is... The CronJob runs every 10 minutes, but If I have 100.000 e-mails to send the script will not be able to send all the 100.000 e-mails in 10 minutes. H

Re: [GENERAL] Database viewpoint of subject - Sending e-mails from database table with Cronjob

2010-04-21 Thread Andre Lopes
Hi, Thanks for the reply. [quote] The other way is to let the cron job spawn new processes (up to a limited number of child proceses) as long as there are mails to send. These child processes runs as long as there are mails to send, then they die. The cron job will then mostly do process controll

Re: [GENERAL] Database viewpoint of subject - Sending e-mails from database table with Cronjob

2010-04-21 Thread Andre Lopes
010 at 3:41 PM, Andre Lopes > wrote: > > Hi, > > > > Thanks for the reply. > > > > [quote] > > The other way is to let the cron job spawn new processes (up to a > > limited number of child proceses) as long as there are mails to send. > > These c

Re: [GENERAL] Database viewpoint of subject - Sending e-mails from database table with Cronjob

2010-04-21 Thread Andre Lopes
Thanks for the reply. I will move the topic to the php/pgsql if I don't get how to do it. Thanks for the help. Best Regards, On Wed, Apr 21, 2010 at 4:49 PM, Bill Moran wrote: > In response to A B : > > > > [quote] > > > The other way is to let the cron job spawn new processes (up to a > > >

[GENERAL] How to allow PostgreSQL to accept remote connection?

2010-04-24 Thread Andre Lopes
Hi, I have a virtual machine with VMWARE, and I need to connect from outside the virtual machine to PostgreSQL. How can I configure the PostgreSQL to accept outside connections? Best Regards,

Re: [GENERAL] How to allow PostgreSQL to accept remote connection?

2010-04-24 Thread Andre Lopes
Fredricson < fredric.fredric...@bonetmail.com> wrote: > Raymond O'Donnell wrote: > >> On 24/04/2010 15:58, Andre Lopes wrote: >> >> >>> Hi, >>> >>> I have a virtual machine with VMWARE, and I need to connect from outside >>> the virtual ma

[GENERAL] Lock table, best option?

2010-04-24 Thread Andre Lopes
Hi, I need to do a SELECT and an UPDATE, but I will have concurrent processes doing the same task. How can I prevent that the concurrent task don't have the same results in the SELECT? Locking a table? How can I do that? Best Regards,

[GENERAL] Problem compiling function with BEGIN WORK; COMMIT WORK;

2010-04-24 Thread Andre Lopes
Hi, I need to use the BEGIN WORK; and COMMIT WORK; to lock a table when I'am doing a SELECT and UPDATE operation. The code is not compiling, the error is: [error]ERROR: syntax error at or near "work" at character 1 QUERY: work CONTEXT: SQL statement in PL/PgSQL function "apr_apanhar_ownership

[GENERAL] User with GRANTS only on Views. Lock table on function will work?

2010-04-25 Thread Andre Lopes
Hi, I have a database were the users only can do operations using views, they have not access to physical tables. But I have a function with a lock on a physical table. Can I allow this users to run a function that locks a physical table? Best Regards,

[GENERAL] Problem saving emails to database.

2010-04-25 Thread Andre Lopes
Hi, It is the first time that I store emails in a database to send them later... Let me explain the problem... I'am sending text emails, and to break the lines of the message I use "\n". The first problem was to stores the "\". To INSERT "\n" I need to write "\\n". When I do a SELECT I see "\n" b

[GENERAL] Dynamic SQL with pgsql, how to?

2010-05-03 Thread Andre Lopes
Hi, I need to write some dynamic SQL in pgsql. I have to do something like this: [code=SQL Server] SET @STRINGN = @STRINGN + ' AND A.' + @CAMPOFECINI + ' IN (SELECT MAX(B.' + @CAMPOFECINI + ') FROM ' + @TABLA + ' B WHERE B.ID_SOCIEDAD = A.ID_SOCIEDAD AND B

Re: [GENERAL] Dynamic SQL with pgsql, how to?

2010-05-03 Thread Andre Lopes
Thanks for the reply's, I need to do a Dynamic SELECT INTO. There is a way of doing it? Best Regards, On Mon, May 3, 2010 at 10:05 AM, A. Kretschmer < andreas.kretsch...@schollglas.com> wrote: > In response to Andre Lopes : > > Hi, > > > > I need to write some

Re: [GENERAL] Dynamic SQL with pgsql, how to?

2010-05-04 Thread Andre Lopes
Thanks for the reply, It is working now. Best Regards. On Tue, May 4, 2010 at 7:44 AM, Maximilian Tyrtania < maximilian.tyrta...@byte-employer.de> wrote: > Am 03.05.2010 um 23:50 schrieb Andre Lopes: > > > Thanks for the reply's, > > > > I need to do a Dyn

[GENERAL] How to exit/abort from a function that returns VOID?

2010-05-04 Thread Andre Lopes
HI, I have a PLPgSQL function that return void but I need to exit the function if some condition returns true. I have tried to do this, but I got an error: [code] IF pVAL_CHAVE_2 > pVAL_CAMPO1 THEN RAISE NOTICE 'O campo data fim tem de ser maior que o campo data inicio.';

Re: [GENERAL] How to exit/abort from a function that returns VOID?

2010-05-04 Thread Andre Lopes
Thanks. I got working. Best Regards, On Tue, May 4, 2010 at 10:25 PM, Adrian Klaver wrote: > On Tuesday 04 May 2010 1:55:35 pm Andre Lopes wrote: > > HI, > > > > I have a PLPgSQL function that return void but I need to exit the > function > > if some conditio

[GENERAL] Function not RAISE NOTICE if a parameter is NULL

2010-05-04 Thread Andre Lopes
Hi, I have a function, that I'm debugging... If I use NULL in any parameter the function does not RAISE any NOTICE. I can't pass NULL values in parameters? [code] select apr_ins_gder_2_1 ('table_fgh' /* Varchar */, 'id_fgh' /* Varchar */, '5' /* Varchar */, NULL /* Date */, '2001-01-05' /* Date

Re: [GENERAL] Function not RAISE NOTICE if a parameter is NULL

2010-05-04 Thread Andre Lopes
ou inserir uma nova linha -- SELECT dat_inicio FROM aae_hist_anuncios WHERE id_anuncio_externo = '5'; -- select max(dat_inicio) as max_dat_inicio from atae_hist_anuncios END IF; END; $BODY$ LANGUAGE PLpgSQL RETURNS NULL ON NULL INPUT VOLATILE

Re: [GENERAL] Function not RAISE NOTICE if a parameter is NULL

2010-05-05 Thread Andre Lopes
Oh... Thanks. What a lame I'm. Best Regards, On Wed, May 5, 2010 at 1:25 AM, Tom Lane wrote: > Andre Lopes writes: > > Thanks for the reply. I have not call it STRICT... > > Yes you are: > > > RETURNS NULL ON NULL INPUT > > regards, tom lane >

[GENERAL] How to deal with NULL values on dynamic queries?

2010-05-06 Thread Andre Lopes
Hi, I have a query that some values could be NULL, how can I deal with this problem? [code] EXECUTE 'INSERT INTO ' || quote_ident(pNOME_VIEW) || '(' || quote_ident(pCHAVE_1) || ', DAT_INICIO, DAT_FIM, COMENT) values (' || quote_literal(pVAL_CHAVE_1)

[GENERAL] Shell script to Backup/Dump Database

2010-05-12 Thread Andre Lopes
Hi, I'am looking fo a shell script do Backup/Dump my PostgreSQL twice a day. I will need to do a full dump (schema + data), schema dump (only schema) and data (only data) There is something done on this subject? I'am very poor in shell script, there are some scripts on the web ready to use? Be

Re: [GENERAL] Shell script to Backup/Dump Database

2010-05-12 Thread Andre Lopes
Regards, On Wed, May 12, 2010 at 4:45 PM, Thom Brown wrote: > On 12 May 2010 16:30, Andre Lopes wrote: > >> Hi, >> >> I'am looking fo a shell script do Backup/Dump my PostgreSQL twice a day. >> >> I will need to do a full dump (schema + data), schema

[GENERAL] How to return an Int4 when subtracting dates/timestamps

2010-05-18 Thread Andre Lopes
Hi, I need to return an Int4 when I do this king of select [code] select CURRENT_DATE - '2009-12-31' from tbl_sometable [/code] This select returns an Interval. How can I return an Integer? Like '138' Sorry my bad english. Best Regards,

[GENERAL] Is postgres installed?

2010-05-21 Thread christophe . andre
Hi, How I know whether Postgres is already installed or not on a machine(on Linux and Windows)? I found that pg_ctl --version could be used or I also tried to check into the registry (for windows HKLM\SOFTWARE\PostgreSQL\Installations), however with Windows Server 2003 pg_ctl is not recognized (pr

[GENERAL] How to return an INT4 subtracting dates?

2010-06-09 Thread Andre Lopes
Hi, I need to return an int4 subtracting two dates, but returns me an interval. select end_date - now() as interger_number from hist_anuncios How to return an integer out of this? Best Regards,

[GENERAL] How to emulate password generation in PHP with PlpgSQL?

2010-06-13 Thread Andre Lopes
Hi, I need to create users in a database function. I'am dealing with a PHP application, the code that generate the password is this: [code] public function salt() { return substr(md5(uniqid(rand(), true)), 0, 10); } public function hash_password($password, $salt=false)

[GENERAL] Hosting without pgcrypto functions. There are other solutions?

2010-06-13 Thread Andre Lopes
Hi, I have an account in A2Hosting.com, and I'm developing some functions that deal with encryption. A2Hosting.com don't have available the function "digest()" [code] ERROR: function digest(unknown, unknown) does not exist LINE 1: select digest('', 'sha1') ^ HINT: No functio

[GENERAL] How to know if an INSERT is done inside a function?

2010-07-04 Thread Andre Lopes
Hi, I have a function, at the end I need to know if the INSERTS have run successfully or not. Here is the function: [code] CREATE OR REPLACE FUNCTION "apr_insert_utilizador_ap" (IN ppgroup_id int4, IN ppip_address char, IN ppusername varchar, IN pppassword varchar, IN ppemail varchar, IN ppactiv

Re: [GENERAL] How to know if an INSERT is done inside a function?

2010-07-04 Thread Andre Lopes
ction not runs successful. How can I do this? Best Regards, On Sun, Jul 4, 2010 at 11:05 AM, Pavel Stehule wrote: > Hello > > every unsuccessful SQL command raises exception in PL/pgSQL. So if > your function is finished without exception, then INSERT is ok. > > Regards

Re: [GENERAL] How to know if an INSERT is done inside a function?

2010-07-04 Thread Andre Lopes
Great! That is what I need! Thank you Pavel. Best Regards, On Sun, Jul 4, 2010 at 12:20 PM, Pavel Stehule wrote: > 2010/7/4 Andre Lopes : > > Hi, > > > > Thanks for your reply. > > > > Yes, in the Postgre command line I see the exception, the problem is that

  1   2   3   >