pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
how to create function/procedure for commenting multiple objects (e.g., columns)
2+ messages / 2 participants
[nested] [flat]

* how to create function/procedure for commenting multiple objects (e.g., columns)
@ 2001-10-11 07:48 Dong B Calmada <dongski@popdem.org>
  2001-10-11 16:39 ` Re: how to create function/procedure for commenting multiple objects (e.g., columns) Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Dong B Calmada @ 2001-10-11 07:48 UTC (permalink / raw)
  To: pgsql-admin

Hi colleagues,

I wanted to create a procedure or function that would facilitate my task of commenting multiple columns.

I tried to do so with the following script:
	create function comment_columns(text,text) returns text as 'comment on $1 is $2' language 'sql';

The attempt produced an error like: error at or near '$1'.

I even tried to create a C solution for this but it only caused a segmentation fault to the backend side.

Please help.

-- 
DONG B. CALMADA
Polmap Chief Information Officer
Institute for Popular Democracy
http://www.ipd.ph
Tel. (63-2) 4346674
Fax (63-2) 9262893
Mobile Phone No. 0917-9339099
Alternate email addresses:
dongski4martin@yahoo.com
dongski@calban.org

-----------------------------------
Information is power!  Set it free!




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: how to create function/procedure for commenting multiple objects (e.g., columns)
  2001-10-11 07:48 how to create function/procedure for commenting multiple objects (e.g., columns) Dong B Calmada <dongski@popdem.org>
@ 2001-10-11 16:39 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2001-10-11 16:39 UTC (permalink / raw)
  To: Dong B Calmada <dongski@popdem.org>; +Cc: pgsql-admin

Dong B Calmada <dongski@popdem.org> writes:
> 	create function comment_columns(text,text) returns text as 'comment on $1 is $2' language 'sql';

> The attempt produced an error like: error at or near '$1'.

Try using plpgsql's EXECUTE to do this.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-10-11 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-10-11 07:48 how to create function/procedure for commenting multiple objects (e.g., columns) Dong B Calmada <dongski@popdem.org>
2001-10-11 16:39 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox