database icon indicating copy to clipboard operation
database copied to clipboard

Support for use tablename acquired as regclass at previous query in PostgreSQL (prevent to "delimite" two times)

Open Vlczech opened this issue 5 years ago • 2 comments

  • bug fix / new feature? Partially both
  • BC break? no
  • doc PR: nette

If data contains special char, table is named with quotation marks also. Thus regclass returns name with quotes and for example operation ->table() delimites such delimited regclass name obtained from SELECT for the second time. So for example $tbl='someschema."some-table"' is in $db->table() delimited to "someschema"."""some-table""".

Note: Tested for PostgreSQL only.

Vlczech avatar Oct 05 '20 17:10 Vlczech

Does this feature apply only to Postgresql, or any other databases?

dg avatar Oct 06 '20 13:10 dg

@dg: I tried to code it to be universal as well for other databases for reverse operation to delimite(), but don't know if any other database has some feature like regclass in postgresql. I don't like to have this feature in ResultSet if it's usable for something specific only (in this case PostgreSQL), so i decided to put it at the driver level :-)

Vlczech avatar Oct 07 '20 19:10 Vlczech