[GENERAL] EXECUTE + transaction = unexpected error -8

2004-02-15 Thread Pascal Polleunus
Hi, It seems that there is a problem when executing a dynamic commands containing a transaction... Here's a simple example... CREATE OR REPLACE FUNCTION fct_trig2() RETURNS TRIGGER AS ' BEGIN EXECUTE ''BEGIN;'' || ''CREATE TABLE t2_'' || NEW.id::TEXT || ''('' || '' CONSTRAINT pkt2_'' |

Re: [GENERAL] function returning a record

2004-02-17 Thread Pascal Polleunus
Ok, I found the solution :-D In the function test(), instead of: SELECT INTO r get_id(''mytable''); The following must be done: SELECT INTO r * FROM get_id(''mytable'') AS (id INT, name VARCHAR(50)); /!\ the datatypes must be EXACTLY the same. For example, specifying CHARACTER VARYING or even VARC

[GENERAL] function returning a record

2004-02-17 Thread Pascal Polleunus
Hi, I'm trying to return a RECORD from a function, but when I try to use the variable I have the following error: ERROR: record "r" has no field "id" Here's an example: CREATE OR REPLACE FUNCTION test() RETURNS CHARACTER VARYING AS ' DECLARE r RECORD; BEGIN SELECT INTO r get_id(''mytable''

Re: [GENERAL] Parse error a in short stored procedure : What's wrong

2004-04-16 Thread Pascal Polleunus
remove a ) at the end, 3 is enough ;-) Bruno BAGUETTE wrote: Hello, I have a PL/PGSQL stored procedure that makes me mad currently... (The stored procedure is a procedure that simulates a materialized view) It complains about a parse error when I call that procedure : WARNING: line 8 at execute

[GENERAL] Synchronize unicode data using copy or pg_dump

2004-04-23 Thread Pascal Polleunus
dexes?) - vacuum (or later?) - import from files (using COPY FROM or pg_restore) - recreate the FK constraints - update the sequences - reindex (or recreate them) Does that sound good? Thanks for you help, Pascal Polleunus ---(end of broadcast)---

Re: [GENERAL] Synchronize unicode data using copy or pg_dump

2004-04-23 Thread Pascal Polleunus
Pascal Polleunus wrote: Hi, I need to synchronize some tables from a database (master) to another one (slave). Both servers are running Debian Woody with PostgreSQL 7.2.1 (postgresql 7.2.1-2woody4). The databases are in unicode and doesn't contain any binary data. The tables have pr