pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedRename constraint?
2+ messages / 2 participants
[nested] [flat]
* Rename constraint?
@ 2003-04-24 15:16 Jeff Boes <jboes@nexcerpt.com>
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Boes @ 2003-04-24 15:16 UTC (permalink / raw)
To: pgsql-admin
I have tables which were created with unnamed constraints:
# \d <table>
...
Check constraints: "bad_job_time" fn_validate_cron(job_time)
"$3" (arguments <> ''::text)
"$2" (job_time <> ''::text)
"periodic_jobs_job_length_bad" (job_length > 0)
How can I identify and rename the "$2" and "$3" constraints?
--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Rename constraint?
@ 2003-04-24 15:41 Tom Lane <tgl@sss.pgh.pa.us>
parent: Jeff Boes <jboes@nexcerpt.com>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2003-04-24 15:41 UTC (permalink / raw)
To: Jeff Boes <jboes@nexcerpt.com>; +Cc: pgsql-admin
Jeff Boes <jboes@nexcerpt.com> writes:
> I have tables which were created with unnamed constraints:
> How can I identify and rename the "$2" and "$3" constraints?
Look in pg_relcheck or pg_constraint, depending on your PG version.
I think you should be able to get away with just updating the name
column. (Not sure whether existing backend sessions will notice such
an update, but at worst starting a fresh session would make it take
effect.)
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-04-24 15:41 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-24 15:16 Rename constraint? Jeff Boes <jboes@nexcerpt.com>
2003-04-24 15:41 ` 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