[GENERAL] can't CREATE TRIGGER

2007-01-21 Thread gustavo halperin
Hello I can't create triggers, when I call for example: ficha=> CREATE TRIGGER TRG_persons_id AFTER INSERT ON ficha_ofperson ficha-> EXECUTE PROCEDURE add_person_id ( 'family_id', 'person_id' ); , the creation never finish and finally, after many minutes, I kill the creation with Ctrl+c. I try

[GENERAL] triggers and TriggerData

2007-01-21 Thread gustavo halperin
First, thank you for your answers about my problem with the function 'CREATE TRIGGER', I have another question about triggers, how can I pass arguments ?? I read about some struct TriggerData *CurrentTriggerData, but I didn't found any explanation or example about how to use it in postgres SQL.

[GENERAL] triggers vs b-tree

2007-01-25 Thread gustavo halperin
Hello I have a design question: I have a table representing Families, and a table representing Persons. The table Family have a row family_id as primary key. The table Person have a row person_id as primary key and contain also a row family_id. As you can understand, the row family_id in a tabl

[GENERAL] SEQUENCE primary key

2007-02-13 Thread gustavo halperin
Hello I have a question, if I have a table with a SEQUENCE primary key, that obviously, I doesn't give in each new row inserted. For example if the table locks: CREATE SEQUENCE id_seq; CREATE TABLE table ( idinteger DEFAULT nextval('id_seq') CONSTRAINT table_id PRIMARY KEY

[GENERAL] postgresql vs mysql

2007-02-20 Thread gustavo halperin
Hello I have a friend that ask me why postgresql is better than mysql. I personally prefer posgresql, but she need to give in her work 3 or 4 strong reasons for that. I mean not to much technical reasons. Can you give help me please ? Thank you, Gustavo -- ||\

[GENERAL] JDBC

2006-07-27 Thread gustavo halperin
Hello I'm new with DB, I'm reading the PostgreSQL doc 8.1. I almost use the PostgreSQL from the 'psql' terminal and also I prove the Toolkit Tora, and Open Office using ODBC driver. I have problem using the JDBC driver, I always receive the error: "A driver is not registered for the URL jdbc:p

[GENERAL] automatic and randomally population

2006-07-27 Thread gustavo halperin
Hello I want try my tables with some thousands of rows. There are any manner to make automatic and randomly population ?? Thank you, Gustavo ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] automatic and randomally population

2006-07-27 Thread gustavo halperin
e with larger DB. I need to build a DB for an old man, and I want give to him the easier client toolkit application. Do you have any recommendation ??    Thank you again,    Gustavo -- Shoaib MirEnterpriseDB ( www.enterprisedb.com)On 7/28/06, gustavo halperin < [EMAIL PROTECTED]> wr

Re: [GENERAL] automatic and randomally population

2006-07-28 Thread gustavo halperin
Richard Huxton wrote: gustavo halperin wrote: On 7/28/06, Shoaib Mir <[EMAIL PROTECTED]> wrote: You can use loops ( http://www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.html). Thanks Are you trying to do some performance analysis for the database server?

[GENERAL] create function syntax error

2006-07-29 Thread gustavo halperin
Hello I Always get "syntax error" for every function that I try to create, for example: mydb'>create or replace function f_sum () returns void as ' mydb'> select 2+2; mydb'> ' LANGUAGE plpgsql; ERROR: syntax error at or near "select" at character 56 LINE 2: select 2+2; ^

[GENERAL] Create function problem

2006-08-03 Thread gustavo halperin
*Hello I have a little question In order to know the names and data types of the table "mil_cien_diez" from the schema "public" I run the next 'SELECT' but when I try to create a SQL function and after it I run it, I receive an empty row. Can you see the problem ??* /mydb=> SELECT c.column_n

Re: [GENERAL] Create function problem

2006-08-03 Thread gustavo halperin
Ron St-Pierre wrote: Check your spelling of public: SELECT * FROM f_describe_tables('pubilc', 'mil_cien_diez'); Ron *OK thank you, you right, but after write "public" I receive again an empty row, Why??. By the way I wrote a short function:* /mydb=> SELECT c.column_name, c.data_type mydb-> F

Re: [GENERAL] Create function problem

2006-08-04 Thread gustavo halperin
Michael Fuhr wrote: [Please copy the mailing list on replies so others can contribute to and learn from the discussion.] On Fri, Aug 04, 2006 at 11:20:55AM +0300, gustavo halperin wrote: Michael Fuhr wrote: You've hardcoded the strings 'v_tbl_schm' and 'v_tbl_na

Re: [GENERAL] Create function problem

2006-08-04 Thread gustavo halperin
Michael Fuhr wrote: On Fri, Aug 04, 2006 at 06:44:16PM +0300, gustavo halperin wrote: Michael Fuhr wrote: Since the function has OUT parameters you can use "RETURNS SETOF record" like this: CREATE FUNCTION funcname() RETURNS SETOF record AS $$ $$ LANGUAGE SQL What d

[GENERAL] REFERENCE problem with parent_table

2006-08-15 Thread gustavo halperin
 Hello I need many tables of type "id" and "name", see below:       CREATE TABLE id_names (       id    smallint    CONSTRAINT the_id PRIMARY KEY NOT NULL,       name    text    CONSTRAINT the_name UNIQUE     ) WITH OIDS; therefore I created these tables with the "LIKE"

Re: [GENERAL] REFERENCE problem with parent_table

2006-08-15 Thread gustavo halperin
Richard Broersma Jr wrote: I need many tables of type "id" and "name", see below: / CREATE TABLE id_names ( idsmallintCONSTRAINT the_id PRIMARY KEY NOT NULL, nametextCONSTRAINT the_name UNIQUE ) WITH OIDS;/ therefore I created these tab

[GENERAL] CONSTRAINT REFERENCE betwen array to single

2006-08-15 Thread gustavo halperin
Hello I have a table with an array of smallint that I want reference to a column of smallint, see below: /database=# CREATE TABLE id_names ( id smallint CONSTRAINT the_id PRIMARY KEY NOT NULL, database(# name text CONSTRAINT the_name UNIQUE ) WITH OIDS; NOTICE: CREATE TABLE / PRIMAR

[GENERAL] Dynamic partial index

2006-08-17 Thread gustavo halperin
Hello I'm interesting in a partial index for a rows that aren't older than 6 mounts, something like the sentence below: /CREATE INDEX name_for_the_index ON table (the_column_of_type_date) WHERE ( the_column_of_type_date > (current_date - interval '6 month')::date );/ But this is n

[GENERAL] Dynamic Partial Index

2006-08-17 Thread gustavo halperin
Hello I'm interesting in a partial index for a rows that aren't older than 6 mounts, something like the sentence below: -- /CREATE INDEX name_for_th

Re: [GENERAL] Dynamic Partial Index

2006-08-17 Thread gustavo halperin
Jeff Davis wrote: On Thu, 2006-08-17 at 20:50 +0300, gustavo halperin wrote: I'm interesting in a partial index for a rows that aren't older than 6 mounts, something like the sent

Re: [GENERAL] Dynamic Partial Index

2006-08-18 Thread gustavo halperin
Jeff Davis wrote: On Fri, 2006-08-18 at 00:19 +0300, gustavo halperin wrote: Create an index on the table, and then periodically move records into a separate archive table. Regards, Jeff Dave Thanks, but I have a question. If the table is a BIIG table, use your solution

[GENERAL] Porting from ORACLE to PostgSQL

2006-09-04 Thread gustavo halperin
Hello I need to porting many old ORACLE-oriented-SQL files and I have many problem with this code. Sometimes the code use some types not supported in PosgSQL like "number" or "varchar2", there fore, can I write some type of declaration (like in c : #define alias_name name) in order to make Po

Re: [GENERAL] Porting from ORACLE to PostgSQL

2006-09-05 Thread gustavo halperin
Chris Mair wrote: I need to porting many old ORACLE-oriented-SQL files and I have many problem with this code. Sometimes the code use some types not supported in PosgSQL like "number" or "varchar2", there fore, can I write some type of declaration (like in c : #define alias_name name) in order

Re: [OT] sig sizes (was Re: [GENERAL] Porting from ...)

2006-09-05 Thread gustavo halperin
Ron Johnson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dave Page wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ron Johnson Sent: 05 September 2006 20:36 To: pgsql-general@postgresql.org Subject: [OT] sig sizes (was Re: [G