WebFaction
Community site: login faq

I've written triggers and other functions for Postgres which work fine on my development PC, but when I deploy them on the Webfaction server I get an

ERROR: ODBC: State 42703: ERROR: record "new" has no field "move";

It seems to see plpgsql's new keyword as a record instead of a plpgsql builtin word.

In initially thought I'd found the problem in the documentation at https://docs.webfaction.com/user-guide/databases.html#enabling-procedural-languages-for-postgresql which said plpgsql is not installed by default. But entering create language plpgsql; at the psql prompt returns

ERROR:  language "plpgsql" already exists

Any suggestions on how to get my pgsql scripts to run?

Robert

asked 18 Apr, 15:22

roblaing
104
accept rate: 0%

edited 21 Apr, 13:06


You would need to use a private database or ask us in a support ticket to import the sql. Triggers require super user access to enable.

permanent link

answered 18 Apr, 21:43

johns ♦♦
5.1k211
accept rate: 22%

Many thanks for the prompt reply. I've found the documentation on installing a private database and will proceed with that.

(19 Apr, 06:06) roblaing

I sorted the problem by not using triggers (which in postgresql are functions without parameters and so have to use the NEW.columname, OLD.columname syntax which may have only been introduced after version 9.4).

By using "normal" plpgsql functions, passing the parameters to the function instead of using NEW.foo, OLD.foo etc, instead of triggers, the script works fine without using a private database instance.

permanent link

answered 21 Apr, 07:57

roblaing
104
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×21
×1

question asked: 18 Apr, 15:22

question was seen: 1,547 times

last updated: 21 Apr, 13:06

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM