[GENERAL] Performance question

2007-08-16 Thread Marcelo de Moraes Serpa
Hello list, If I've got a trigger that calls a function each time there is a DELETE or UPDATE opration on a table in my system, and in this function I retrieve some boolean information from another table and based on this information, additional code will be ran or not in this function. Could the

[GENERAL] Audit-trail engine inner-workings

2007-08-21 Thread Marcelo de Moraes Serpa
Hello list, Taking this discussion as a base: http://archives.postgresql.org/pgsql-general/2007-04/msg01034.php Manuel helped me to develop an audit-trail engine, and even though it works ok, I need to know better its inner workings: >From what I understand, the flow is something like this:

Re: [GENERAL] Audit-trail engine inner-workings

2007-08-22 Thread Marcelo de Moraes Serpa
on to the server so that that the audit-trail can log it altogether). Once the operation is done and the connection is back to the pool, does PostgreSQL discart the associated var ? Does it mantain one "instance" per request made ? That's what I would like to know. Thanks, On 8/21/0

[GENERAL] create or replace for tables and schemas

2007-08-27 Thread Marcelo de Moraes Serpa
For some weid reason, I can't use a stored function nor return data from sql, just send sql to the database, that's my constraint for now and I have to deal with it. I have to create a schema and just after a table in this schema. I can't check for the existence of the table nor the schema. If the

Re: [GENERAL] create or replace for tables and schemas

2007-08-27 Thread Marcelo de Moraes Serpa
Thanks Martijn On 8/27/07, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > > On Mon, Aug 27, 2007 at 08:24:51AM -0300, Marcelo de Moraes Serpa wrote: > > With this in mind, I'd like to know if there is something like CREATE OR > > REPLACE for tables and schemas

[GENERAL] [ERROR] syntax error at end of input

2007-08-27 Thread Marcelo de Moraes Serpa
Hello list, I'm trying to execute the following sentences in a pl/pgsql function. aNomeProcAudita and pTabAudit are both variables. DROP FUNCTION IF EXISTS aNomeProcAudita; DROP TRIGGER IF EXISTS 'Audita_' || pTabAudit || '_trigger'; When I try to create this function with

[GENERAL] difference between function and stored procedure

2007-08-28 Thread Marcelo de Moraes Serpa
Hello list, Is there any difference between a PGSQL Function and Stored Procedure in PostgreSQL (8.2) ? If so, what difference? Is the SQL used to create a SP different from the SQL used to create a function ? Thanks in advance, Marcelo.

[GENERAL] Can´t connect but listen address and pg_hba configured correctly

2008-04-10 Thread Marcelo de Moraes Serpa
I can´t connect to my postgresql8.1 server running on Debian. The pgadmin client says it can't connect. I already edited the pg_hba.conf and postgresql.conf (listen_addresses = '*' and port) but the problem remains, pg_admin is running on a XP machine without Firewalls enabled, Debian is also not

Re: [GENERAL] Can´t connect but listen address and pg_hba configured correctly

2008-04-10 Thread Marcelo de Moraes Serpa
or host "IPADDRESS", user "USER", database > "DATABASE", SSL ON/OFF > > Are you getting a similar message or is the connection timing out? > > > Marcelo de Moraes Serpa wrote: > > > I can´t connect to my postgresql8.1 server running on Debian

[GENERAL] Prefix LIKE search and indexes issue.

2010-07-23 Thread Marcelo de Moraes Serpa
Hello list, So, I have a small query design issue and I'd like to borrow some of your wisdom. Let's say I a users relation, and each user has a reversed_domain field. id | name | reversed_domain 1Josh com.app ... I then have a firefox plugin which makes request to my application serve

[GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-24 Thread Marcelo de Moraes Serpa
Hey guys, I needed to implement an audit trail engine and decided to do it on the database layer. I already have a basic but fully functional audit trail system implemented on my PostgreSQL 8.2 server. It has been done using PL/PGSQL and triggers and it works pretty well. Here's what I need to

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-24 Thread Marcelo de Moraes Serpa
I forgot to add the link to the article I've mentioned: http://www-128.ibm.com/developerworks/db2/library/techarticle/0302stolze/0302stolze.html#section2b This is what I'd like to do on PostgreSQL, Thanks, Marcelo. On 4/24/07, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-24 Thread Marcelo de Moraes Serpa
nection id" you say equivalent to the "applicationid" mentioned in the ibm db2 article? If so, how could I get this data through my application? On 4/24/07, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote: Thank you for the replies. @Richard: I've thought about having on

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-25 Thread Marcelo de Moraes Serpa
wrote: -- *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Marcelo de Moraes Serpa *Sent:* dinsdag 24 april 2007 21:06 *To:* pgsql-general@postgresql.org *Subject:* Re: [GENERAL] Audit-trail engine: getting the application's layer user_id Thank you for

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-25 Thread Marcelo de Moraes Serpa
Hi Manuel, just a quick question: What C libraries do I need to compile this function? Or better: Where can I find a reference manual about db stored procedures written in C for PostgreSQL? Thanks! On 4/24/07, Manuel Sugawara <[EMAIL PROTECTED]> wrote: "Marcelo de Moraes Ser

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-25 Thread Marcelo de Moraes Serpa
Windows - you can see it here: http://www.postgresql.org/docs/8.0/interactive/xfunc-c.html Thank you again. Marcelo. On 4/24/07, Manuel Sugawara <[EMAIL PROTECTED]> wrote: "Marcelo de Moraes Serpa" <[EMAIL PROTECTED]> writes: > Hey guys, > > Mine is an web applicat

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-25 Thread Marcelo de Moraes Serpa
framework (Actually it is an data-oriented application generator, called GeneXus). Thanks, Marcelo. On 4/25/07, Manuel Sugawara <[EMAIL PROTECTED]> wrote: "Marcelo de Moraes Serpa" <[EMAIL PROTECTED]> writes: > I'm sorry Manuel, but after some time trying to ful

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-25 Thread Marcelo de Moraes Serpa
Marcelo. On 4/25/07, Manuel Sugawara <[EMAIL PROTECTED]> wrote: "Marcelo de Moraes Serpa" <[EMAIL PROTECTED]> writes: > Hi Manuel, > >> each time the user sends a request I do more or less the following: > > Could a trigger be used to implement this ? Or a

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-25 Thread Marcelo de Moraes Serpa
grateful as I really need this thing working as soon as possible. Thanks, Marcelo. On 4/25/07, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote: I'm doing it form the application layer and I don't think it can be > done in the database layer, how the trigger will figure ou

[GENERAL] "WARNING Bison install not found, or unsupported Bison version."

2007-04-26 Thread Marcelo de Moraes Serpa
I'm trying to build PostgreSQL 8.2 on Windows XP PRO. I've already downloaded and configured all the dependencies, including bison and flex. However, when I try to make it I receive the following error: "WARNING Bison install not found, or unsupported Bison version. Attempting to build without."

[GENERAL] Compiling PostgreSQL 8.2 on Windows using msvc2k5

2007-04-26 Thread Marcelo de Moraes Serpa
Hello! I'd like to learn more about PostgreSQL (8.x) internal architecture so as to build C extensions and Stored Procedures in C. I think that I nice way to start is trying to compile PostgreSQL from the source. I'm on Windows XP PRO. I've found this article: http://developer.postgresql.org/pgdo

[GENERAL] Using a library compiled for 8.3 in 8.2

2007-04-27 Thread Marcelo de Moraes Serpa
Hello! Today, I have finally managed to compile PostgreSQL 8.3devel using Visual C++ 2005 on Windows XP PRO. It was a tough process as I've never hacked such a big OS project like PGSQL. I did it becouse I needed to develop some C functions that will be exported as functions to be called as Store

[GENERAL] postgres.exe - Entry point not found (PostgreSQL 8.3 devel)

2007-04-27 Thread Marcelo de Moraes Serpa
Hello, I have compiled PostgreSQL 8.3devel using Microsoft Visual C++ 2005 but when I tried to start it (either by using the initdb.exe or postgres.exe) I receive the following error message: Message title: "postgres.exe - Entry point not found" Message body: "It wasn't possible to find the entr

[GENERAL] "Protocol error. Session setup failed" (PostgreSQL 8.3devel/postgresql-8.3dev-600.jdbc3)

2007-04-28 Thread Marcelo de Moraes Serpa
Hello, I've built PostgreSQL 8.3 devel with VC++ 2005, done all the db initialization process (creating the data dir using initdb, registering it as a service using pg_ctl, etc) and tested by connecting to it through pgAdmin III, I even built a C extension and ran it as a SP in the pgAdmin SQL co

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-05-09 Thread Marcelo de Moraes Serpa
TED]> wrote: "Marcelo de Moraes Serpa" <[EMAIL PROTECTED]> writes: > Hey guys, > > Mine is an web application - three tier. The app connects to the db using > only one user and it has it's own authentication system and doesn't > rely on the database for u