aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/dumputils.c
Commit message (Collapse)AuthorAge
...
* Fix pg_dump to do the right thing when escaping the contents of large objects.Tom Lane2009-08-04
| | | | | | | | | | | | | | | | The previous implementation got it right in most cases but failed in one: if you pg_dump into an archive with standard_conforming_strings enabled, then pg_restore to a script file (not directly to a database), the script will set standard_conforming_strings = on but then emit large object data as nonstandardly-escaped strings. At the moment the code is made to emit hex-format bytea strings when dumping to a script file. We might want to change to old-style escaping for backwards compatibility, but that would be slower and bulkier. If we do, it's just a matter of reimplementing appendByteaLiteral(). This has been broken for a long time, but given the lack of field complaints I'm not going to worry about back-patching.
* Tweak the core scanner so that it can be used by plpgsql too.Tom Lane2009-07-14
| | | | | | | | | | | | | | Changes: Pass in the keyword lookup array instead of having it be hardwired. (This incidentally allows elimination of some duplicate coding in ecpg.) Re-order the token declarations in gram.y so that non-keyword tokens have numbers that won't change when keywords are added or removed. Add ".." and ":=" to the set of tokens recognized by scan.l. (Since these combinations are nowhere legal in core SQL, this does not change anything except the precise wording of the error you get when you write this.)
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-11
| | | | provided by Andrew.
* Use thread-local storage for querybuffer in fmtId() on Windows, when needed ↵Andrew Dunstan2009-03-11
| | | | | | | | (i.e. when running pg_restore, which might run in parallel). Only reopen archive file when we really need to read from it, in parallel code. Otherwise, close it immediately in a worker, if possible.
* Support column-level privileges, as required by SQL standard.Tom Lane2009-01-22
| | | | Stephen Frost, with help from KaiGai Kohei and others
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* SQL/MED catalog manipulation facilitiesPeter Eisentraut2008-12-19
| | | | | | | | This doesn't do any remote or external things yet, but it gives modules like plproxy and dblink a standardized and future-proof system for managing their connection information. Martin Pihlak and Peter Eisentraut
* Create a separate grantable privilege for TRUNCATE, rather than having it beTom Lane2008-09-08
| | | | | | | always owner-only. The TRUNCATE privilege works identically to the DELETE privilege so far as interactions with the rest of the system go. Robert Haas
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Use "alternative" instead of "alternate" where it is clearer.Peter Eisentraut2007-11-07
|
* Adjust processSQLNamePattern() so that $ within the pattern is always matchedTom Lane2007-07-10
| | | | | | | | literally, whether quoted or not. Since we allow $ as a character within identifiers, this behavior is useful, whereas the previous behavior of treating it as the regexp ending anchor was nearly useless given that the pattern is automatically anchored anyway. This affects the arguments of psql's \d commands as well as pg_dump's -n and -t switches. Per discussion.
* Arrange for quote_identifier() and pg_dump to not quote keywords that areTom Lane2007-06-18
| | | | | | | | | | | | | unreserved according to the grammar. The list of unreserved words has gotten extensive enough that the unnecessary quoting is becoming a bit of an eyesore. To do this, add knowledge of the keyword category to keywords.c's table. (Someday we might be able to generate keywords.c's table and the keyword lists in gram.y from a common source.) For the moment, lie about WITH's status in the table so it will still get quoted --- this is because of the expectation that WITH will become reserved when the SQL recursive-queries patch gets done. I didn't force initdb because this affects nothing on-disk; but note that a few regression tests have changed expected output.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* Tweak pg_dumpall to add GRANT CONNECT ON DATABASE ... TO PUBLIC when dumpingTom Lane2007-01-04
| | | | | | database privileges from a pre-8.2 server. This ensures that the reloaded database will maintain the same behavior it had in the previous installation, ie, everybody has connect privilege. Per gripe from L Bayuk.
* Move processNamePattern into dumputils.c in preparation for using it inTom Lane2006-10-09
| | | | | | | pg_dump as well as psql. Since psql already uses dumputils.c, while there's not any code sharing in the other direction, this seems the easiest way. Also, fix misinterpretation of patterns using regex | by adding parentheses (same bug found previously in similar_escape()). This should be backpatched.
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Fix pg_dump for recent change removing separate RULE privilege.Tom Lane2006-09-08
| | | | | I had thought this code could be left alone, but I was wrong: as-is it's failing to recognize when to use ALL for table privileges in 8.2.
* Fix up hack to suppress escape_string_warning so that it actually worksTom Lane2006-06-01
| | | | | | and there's only one place that's a kluge, ie, appendStringLiteralConn. Note that pg_dump itself doesn't use appendStringLiteralConn, so its behavior is not affected; only the other utility programs care.
* Fix up pg_dump to do string escaping fully correctly for client encodingTom Lane2006-05-28
| | | | | | | | | and standard_conforming_strings; likewise for the other client programs that need it. As per previous discussion, a pg_dump dump now conforms to the standard_conforming_strings setting of the source database. We don't use E'' syntax in the dump, thereby improving portability of the SQL. I added a SET escape_strings_warning = off command to keep the dumps from getting a lot of back-chatter from that.
* Use E'' strings internally only when standard_conforming_strings =Bruce Momjian2006-05-26
| | | | | | | | | 'off'. This allows pg_dump output with standard_conforming_strings = 'on' to generate proper strings that can be loaded into other databases without the backslash doubling we typically do. I have added the dumping of the standard_conforming_strings value to pg_dump. I also added standard backslash handling for plpgsql.
* Code review for GRANT CONNECT patch. Spell the privilege as CONNECT notTom Lane2006-04-30
| | | | | CONNECTION, fix a number of places that were missed (eg pg_dump support), avoid executing an extra search of pg_database during startup.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Add GRANT ON SEQUENCE syntax to support sequence-only permissions.Bruce Momjian2006-01-21
| | | | | | | | | | | | | Continue to support GRANT ON [TABLE] for sequences for backward compatibility; issue warning for invalid sequence permissions. [Backward compatibility warning message.] Add USAGE permission for sequences that allows only currval() and nextval(), not setval(). Mention object name in grant/revoke warnings because of possible multi-object operations.
* Brace cleanup.Bruce Momjian2006-01-11
|
* Treat procedural languages as owned by the bootstrap superuser, ratherTom Lane2005-12-03
| | | | | | | | | than owned by nobody. This results in cleaner display of language ACLs, since the backend's aclchk.c uses the same convention. AFAICS there is no practical difference but it's nice to avoid emitting SET SESSION AUTHORIZATION; also this will make it easier to transition pg_dump to some future version in which we may include an explicit ownership column in pg_language. Per gripe from David Begley.
* Fix obsolete comment.Tom Lane2005-12-02
|
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Add E'' to internally created SQL strings that contain backslashes.Bruce Momjian2005-07-02
| | | | Improve code clarity by using macros for E'' processing.
* Add code to pg_dump to use E'' strings when backslashes are used in dumpBruce Momjian2005-07-01
| | | | files.
* GCC 4.0 includes a new warning option, -Wformat-literal, that emitsNeil Conway2005-04-30
| | | | | | | | | | | | | | | a warning when a variable is used as a format string for printf() and similar functions (if the variable is derived from untrusted data, it could include unexpected formatting sequences). This emits too many warnings to be enabled by default, but it does flag a few dubious constructs in the Postgres tree. This patch fixes up the obvious variants: functions that are passed a variable format string but no additional arguments. Most of these are harmless (e.g. the ruleutils stuff), but there is at least one actual bug here: if you create a trigger named "%sfoo", pg_dump will read uninitialized memory and fail to dump the trigger correctly.
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-31
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Pgindent run for 8.0.Bruce Momjian2004-08-29
|
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* Tablespaces. Alternate database locations are dead, long live tablespaces.Tom Lane2004-06-18
| | | | | | | | | There are various things left to do: contrib dbsize and oid2name modules need work, and so does the documentation. Also someone should think about COMMENT ON TABLESPACE and maybe RENAME TABLESPACE. Also initlocation is dead, it just doesn't know it yet. Gavin Sherry and Tom Lane.
* Use dollar-quoting for function bodies, unless disabled withTom Lane2004-03-23
| | | | | | --disable-dollar-quoting. Andrew Dunstan
* pg_dump support for function parameter names.Tom Lane2004-01-07
|
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-29
|
* Handle double-quotes correctly in user names in ACL lists.Tom Lane2003-08-14
| | | | Christopher Kings-Lynne
* Update copyrights to 2003.Bruce Momjian2003-08-04
|
* pgindent run.Bruce Momjian2003-08-04
|
* Upgrade parsing code for ACLs to be less hokey and more cognizant ofTom Lane2003-07-31
| | | | | the actual logical structure and quoting rules being used. Fixes bug reported by Chris K-L on 7/8/03.
* Fix grant option dumping and related cross-version compatibility issues.Peter Eisentraut2003-07-24
|
* Cause pg_dumpall to include GRANT/REVOKE for database-level permissionsTom Lane2003-05-30
| | | | in its output. Make it work with server versions back to 7.0, too.
* Allow pg_dumpall to work with previous releases again. Don't pass the -cPeter Eisentraut2002-09-07
| | | | | option down to pg_dump, where it's useless, and clarify the meaning of -c in the documentation.
* pgindent run.Bruce Momjian2002-09-04
|
* Reimplement pg_dumpall in C. Currently no change in functionality,Peter Eisentraut2002-08-27
except that it's more robust, reconnects less often, and is NLS'ed.