Re: ALTER PUBLICATION

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, October 30, 2018, Lalith Tenneti <lalithkx@xxxxxxxxx> wrote:
Hi All,

I am trying to run ALTER PUBLICATION ABC ADD TABLE <variable>. The variable is being set in a SELECT statement beforehand. But the ALTER statement adds the literal variable name. Is there anyway to acheive this? The reason is I do not want to hard code the table names.

=============

SQL doesn’t have variables and <variable> is not valid psql syntax.  If you are doing this in pl/pgsql you will need to use EXECUTE and dynamic SQL and inject the variable into the statement string using format(stmt, variable) where stmt = “... ADD TABLE %I”

David J.


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux