Greenplum isn't PostgreSQL, it's a separate product based on PostgreSQL 8.2.
DO
was added in PostgreSQL 9.0. So this won't work on Greenplum. You must create then execute a function. If you don't have the rights to do that, you're just out of luck, you cannot use PL/PgSQL.
PostgreSQL supports DBLink
(see dblink
in the docs) for cross-database connections. I have no idea whether it's supported by Greenplum.
In future questions ensure that:
- You tag them
greenplum
as well aspostgresql
- If you get an error, you give the exact text of the error message.
Thanks for including the code and mentioning that you were using PostgreSQL and Greenplum, though.