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_'' |
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
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''
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
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)---
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