[postgis-users] shp2pgsql and schemas
Seamus Thomas Carroll
carrolls at cpsc.ucalgary.ca
Fri Dec 12 15:02:07 PST 2003
The updated code is:
input := ''ALTER TABLE '' || quote_ident(schema_name) || ''.'' || quote_ident(table_name) || '' ADD COLUMN '' || quote_ident(column_name) || '' geometry '';
RAISE NOTICE ''input: %'', input;
EXECUTE input;
RAISE NOTICE exec finished;
And the new output is:
psql:toload.txt:2: ERROR: syntax error at or near "exec"
CONTEXT: compile of PL/pgSQL function "addgeometrycolumn" near line 43
No output is given for the first RAISE NOTICE. The the_geom column is
still not added to the created table.
Seamus
On Fri, 12 Dec 2003, David Blasby wrote:
> Seamus Thomas Carroll wrote:
> > I have changed the code to:
> > input := ''ALTER TABLE '' || quote_ident(schema_name) || ''.'' || quote_ident(table_name) || '' ADD COLUMN '' || quote_ident(column_name) || '' geometry '';
> > RAISE NOTICE ''input: %'', input;
> > EXECUTE input;
> >
> > and the output is now:
> > psql:toload.txt:2: NOTICE: input: ALTER TABLE roads.carrolls_route_alberta_test ADD COLUMN the_geom geometry
> > psql:toload.txt:2: ERROR: syntax error at or near "$3" at character 70
> > CONTEXT: PL/pgSQL function "addgeometrycolumn" line 69 at return
> >
> > if I copy the result of the notice and paste it into the psql prompt it
> > works without error.
> >
> > Could this be a error in posgtres that is causing a syntax error when one
> > is not present?
>
> Try putting a "RAISE NOTICE exec finished" immediately after the EXECUTE.
>
> dave
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
More information about the postgis-users
mailing list