[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] 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] 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] 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
ÜNDÜZ : > On Wed, 2011-08-17 at 06:28 -0700, Andre Lopes wrote: >> >> 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. > > If you are using RPMS, then install -co

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] 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

[GENERAL] Open Source Forum Software using PostgreSQL?

2010-07-04 Thread Andre Lopes
Hi, I need to use an Forum Software. There is any Open Souce Forum Script using PostgreSQL? Best Regards, André.

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

2010-07-04 Thread Andre Lopes
Hi, The function will run in the php-cli, in a CronJob, it is not for use in a PHP webpage. I think doesn't matter the extra time that takes to run. Best Regards, On Sun, Jul 4, 2010 at 4:11 PM, Pavel Stehule wrote: > 2010/7/4 Merlin Moncure : > > On Sun, Jul 4, 2010 at 7:25 A

[GENERAL] Rules in views, how to?

2010-07-06 Thread Andre Lopes
Hi, I'am using rules in views, but I'am not sure about how the rules work... let me explain... For example, I have this table: [code] CREATE TABLE "atau_utilizadores" ( "id" int4 NOT NULL, "group_id" int4 NOT NULL, "ip_address" char(16) NOT NULL, "username" varchar(50) NOT NULL,

[GENERAL] Rules in views, how to?

2010-07-06 Thread Andre Lopes
Hi, I'am using rules in views, but I'am not sure about how the rules work... let me explain... For example, I have this table: [code] CREATE TABLE "atau_utilizadores" ( "id" int4 NOT NULL, "group_id" int4 NOT NULL, "ip_address" char(16) NOT NULL, "username" varchar(50) NOT NULL,

Re: [GENERAL] Rules in views, how to?

2010-07-06 Thread Andre Lopes
, 2010 at 11:54 AM, Alban Hertroys < dal...@solfertje.student.utwente.nl> wrote: > On 6 Jul 2010, at 12:28, Andre Lopes wrote: > > > Now I need also to add an INSTEAD UPDATE rule and an INSTEAD DELETE rule, > but I have some doubts about it... let me explain... > >

Re: [GENERAL] [SOLVED] Rules in views, how to?

2010-07-06 Thread Andre Lopes
= NEW.remember_code, created_on = NEW.created_on, last_login = NEW.last_login, active = NEW.active where (id = OLD.id or username = OLD.username or email = OLD.email) [/code] Best Regards, On Tue, Jul 6, 2010 at 12:03 PM, Andre Lopes wrote: > Hi Alban, > > But in my application I have more than o

Re: [GENERAL] [SOLVED] Rules in views, how to?

2010-07-06 Thread Andre Lopes
; [/code] If I use the clause WHERE only in "id" will not work fot both cases, or will work? Best Regards, On Tue, Jul 6, 2010 at 12:46 PM, Sam Mason wrote: > On Tue, Jul 06, 2010 at 12:28:35PM +0100, Andre Lopes wrote: > > Ok, I have done the UPDATE RULE like this and

[GENERAL] How to import *.sql file to postgresql database

2010-07-18 Thread Andre Lopes
Hi, I have a DUMP file with INSERT's commands. I need to import this data to postgresql database with the "psql" command. How can I do this task? Best Regards,

Re: [GENERAL] How to import *.sql file to postgresql database

2010-07-18 Thread Andre Lopes
þ- ^ [/quote] How should I solve this problem? Best Regards, On Sun, Jul 18, 2010 at 9:10 PM, Szymon Guz wrote: > > > 2010/7/18 Andre Lopes > > Hi, >> >> I have a DUMP file with INSERT's commands. I need to import this data to >> postgresql database

Re: [GENERAL] How to import *.sql file to postgresql database

2010-07-18 Thread Andre Lopes
more can I do? Best Regards, On Sun, Jul 18, 2010 at 9:11 PM, Edoardo Panfili wrote: > On 18/07/10 22.06, Andre Lopes wrote: > >> Hi, >> >> I have a DUMP file with INSERT's commands. I need to import this data to >> postgresql database with the "psql"

[GENERAL] How to change the file encoding of a 3gb file?

2010-07-18 Thread Andre Lopes
Hi, I'am trying to import an SQL file with 3gb of INSERTS. I must to change the encode of the file to UTF8, how can I change the encode of the file without open it? This 3gb file crashes every program... Give me a clue. Best Regards,

[GENERAL] How to add permissions to views?

2010-08-13 Thread Andre Lopes
Hi, I have developed a database system where every table have a view mapping the contents, so the users don't have direct access to the tables. For UPDATE and DELETE I have created RULES on the views. My question: I will create a user to give permissions to the views. I don't know what kind of p

[GENERAL] How to dump only the the data without schema?

2010-09-25 Thread Andre Lopes
Hi, I need to generate the dump of a PostgreSQL database only with the data with INSERT's. It is possible to do this? Best Regards,

[GENERAL] How to use pg_restore with *.sql file?

2010-09-25 Thread Andre Lopes
Hi, I have generate an *.sql file with the command: [quote] pg_dump -a --inserts databasename > exportfilename.sql [/quote] How can I use the pg_restore to import the data to the database? I have tried: [quote] pg_restore -d databasename exportfilename.sql [/quote] But without success... Wha

Re: [GENERAL] How to use pg_restore with *.sql file?

2010-09-25 Thread Andre Lopes
Thanks a lot! It works. On Sat, Sep 25, 2010 at 1:23 PM, Scott Marlowe wrote: > On Sat, Sep 25, 2010 at 6:19 AM, Andre Lopes > wrote: > > Hi, > > > > I have generate an *.sql file with the command: > > > > [quote] > > pg_dump -a --inserts dat

[GENERAL] Postgres for mobile website?

2009-11-03 Thread Andre Lopes
Hi, I have a website using Postgres database. Now I need to develop a mobile website, what should I do? Use the Postgres database or copy the information of the database to a SQLite database? Postgres isn't heavy to a mobile website? The website is update 2 times month. I can easly sincronize th

[GENERAL] How to auto-increment?

2009-12-02 Thread Andre Lopes
Hi, I have a table like this: id_product id_increment and I need to increment values in id_increment like this prod_1 1 prod_1 2 prod_1 3 prod_2 1 Wich is the best way to do this? Using a trigger? Where can I find examples of plpgsql doing this? Best Regards, André. Sorry for my bad engli

[GENERAL] What packages I need to install to get Postgres working

2009-12-06 Thread Andre Lopes
Hi, I have used Postgres on windows, but now I need to develop a website in Linux envoirnment. I have installed Ubuntu Desktop, but now I need to know what packages install to get Postgres working. Best Regards, André.

Re: [GENERAL] What packages I need to install to get Postgres working

2009-12-06 Thread Andre Lopes
:48 PM, Raymond O'Donnell wrote: > On 06/12/2009 21:35, Andre Lopes wrote: > > > I have used Postgres on windows, but now I need to develop a website in > > Linux envoirnment. > > > > I have installed Ubuntu Desktop, but now I need to know what packages > &g

[GENERAL] Something like Oracle Forms, but Open Source to use with PostgreSQL?

2009-12-20 Thread Andre Lopes
Hi, I need to know if there is something like Oracle Forms in the Open Source world that works with PostgreSQL. If do you know something, please let me know. Best Regards, André.

Re: [GENERAL] Something like Oracle Forms, but Open Source to use with PostgreSQL?

2009-12-21 Thread Andre Lopes
orary solution for this... With .NET should be quick to develop some CRUD interface? What alternatives I have to .NET? there are Open Source GUI frameworks that do the same that .NET? Best Regads, André. On Sun, Dec 20, 2009 at 10:06 PM, Allan Kamau wrote: > On Mon, Dec 21, 2009 at 12:13 A

  1   2   >