Re: enforce naming convention - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: enforce naming convention
Date
Msg-id e431da62ba2b663a7e772ae99a87edc9@biglumber.com
Whole thread Raw
In response to enforce naming convention  ("SunWuKung" <Balazs.Klein@t-online.hu>)
Responses Re: enforce naming convention  ("SunWuKung" <Balazs.Klein@t-online.hu>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> Can I create a trigger that runs when a new object is created and see
> if its name is in an expected format and if not reject it?

Sounds like you need a database-wide trigger on DDL. PostgreSQL has nothing
like that at the moment. Your best bet for now is to try and control it
at the application level. You could also run an external program (daemon or
even a cron job) that continually checks for such a violation and reports
it somewhere.

> I had to create a new schema 'zref' storing some of our tables to
> conceptually separate them but I want to make sure that when we create
> new tables we can't have the same table name in 'zref' and 'public'.

Allowing two tables with the same name to exist is a prime feature of schemas,
so working around that is not generally something that is done. :)

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200604150915
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFEQPLxvJuQZxSWSsgRAuP8AJ9awH/+0D8Iy6+hc9qDmbrDDgpWHACgkGFS
pQMAGEFJWUbuonyN5+m15wE=
=b825
-----END PGP SIGNATURE-----



pgsql-general by date:

Previous
From: "SunWuKung"
Date:
Subject: enforce naming convention
Next
From: "Nik"
Date:
Subject: Comparing text field