summaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
AgeCommit message (Collapse)Author
2001-09-10> NOTE: in the command.c in three places there (I believe) is a typo:Bruce Momjian
> > "parse error at [the] end of line" > > Attached patch also fixes it. I noticed this while editing the po file. > If I'm wrong, please ignore the command.c.patch. I will revert my translation > as well then. > > -- > Serguei A. Mokhov
2001-09-02Parse the arguments of \connect as SQL identifiers, so that they exposePeter Eisentraut
the expected behavior in mixed-case situations. bug report from James Pattie, 2001-08-31
2001-06-08Finish German translation, edit (original) messages a bit.Peter Eisentraut
2001-06-02Native Language Support (NLS)Peter Eisentraut
Use --enable-nls to turn it on; see installation instructions for details. See developer's guide how to make use of it in programs and how to add translations. psql sources have been almost fully prepared and an incomplete German translation has been provided. In the backend, only elog() calls are currently translatable, and the provided German translation file is more of a placeholder.
2001-05-12Add command '\pset footer' to psql to turn off default "(x rows)" footer.Peter Eisentraut
2001-05-12Add comment to explain need for bizarre-looking coding in HandleSlashCmds.Tom Lane
2001-05-09Here's a version of my suggested diffs transplanted to 7.1 beta 5. I'mBruce Momjian
still looking at the best way to integrate Tom Vijlbrief's fixes (insofar as they're still needed); would 7.2 be a suitable time for incompatible API changes? Jeroen Changes: (*) Introduced bool, true, false (replacing some int, 1, 0) (*) Made some member functions const (*) Documented GetIsNull() (*) Marked DisplayTuples() and PrintTuples() as obsolescent; fixed possible portability problem (assumed that NULL pointer equals all-zero bit pattern) (*) PrintTuples(): renamed width parameter to fillAlign to conform with other usage; fixed memory leak and compile issue w.r.t. field separator (should also slightly improve performance) (*) Fixed some minor compilation issues (*) Moved "using namespace std;" out of headers, where they didn't belong; used new (temporary) preprocessor macro PGSTD to do this (*) Made ToString() static, removed unneeded memset(), made buffer size adapt to sizeof(int) (*) Made some constructors explicit (*) Changed some const std::string & parameters to plain std::string (*) Marked PgCursor::Cursor(std::string) as obsolescent (setter with same name as getter--bad style) (*) Renamed some paramaters previously named "string" (*) Introduced size_type typedef for number of tuples in result set (*) PgTransaction now supports re-opening after closing, and aborts if not explicitly committed prior to destruction J. T. Vermeulen
2001-05-07Add \cd command to psql.Peter Eisentraut
2001-05-06Fix collateral damage from previous (rev 1.49) patch.Peter Eisentraut
2001-04-18Repair misbehavior of \! with immediately following argument that containsPeter Eisentraut
spaces (e.g., '\!ls -l'). Also correct a comment.
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-02-17Fix a bug in psql. unescape() does not work for multi-byte encodings.Tatsuo Ishii
2001-02-10Restructure the key include files per recent pghackers discussion: thereTom Lane
are now separate files "postgres.h" and "postgres_fe.h", which are meant to be the primary include files for backend .c files and frontend .c files respectively. By default, only include files meant for frontend use are installed into the installation include directory. There is a new make target 'make install-all-headers' that adds the whole content of the src/include tree to the installed fileset, for use by people who want to develop server-side code without keeping the complete source tree on hand. Cleaned up a whole lot of crufty and inconsistent header inclusions.
2001-01-27Here is an update on the Win32 patch. Modified files are 'config.h.win32'Bruce Momjian
and two 'win32.mak'. Addresses the following: 1) Oops. Spelled fcntl.h wrong in the last one. D'uh. 2) PG_VERSION changed to be defined with " around it. psql/command.c failed to compile without that. 3) Changed makefiles to use "/MD" and link both psql and libpq.dll against MSVCRT.DLL instead of a static library. This takes care of the crash-upon-free in psql. I *think* this is what is on the "Open 7.1 Items" list as "Magnus Hagander ODBC Issues?". It has nothing to do with ODBC, but it's the only issue I've been involved with... Magnus Hagander
2001-01-24Here is a patch to make the current snapshot compile on Win32 (native, libpqBruce Momjian
and psql) again. Changes are: 1) psql requires the includes of "io.h" and "fcntl.h" in command.c in order to make a call to open() work (io.h for _open(), fcntl.h for the O_xxx) 2) PG_VERSION is no longer defined in version.h[.in], but in configure.in. Since we don't do configure on native win32, we need to put it in config.h.win32 :-( 3) Added define of SYSCONFDIR to config.h.win32 - libpq won't compile without it. This functionality is *NOT* tested - it's just defined as "" for now. May work, may not. 4) DEF_PGPORT renamed to DEF_PGPORT_STR I have done the "basic tests" on it - it connects to a database, and I can run queries. Haven't tested any of the fancier functions (yet). However, I stepped on a much bigger problem when fixing psql to work. It no longer works when linked against the .DLL version of libpq (which the Makefile does for it). I have left it linked against this version anyway, pending the comments I get on this mail :-) The problem is that there are strings being allocated from libpq.dll using PQExpBuffers (for example, initPQExpBuffer() on line 92 of input.c). These are being allocated using the malloc function used by libpq.dll. This function *may* be different from the malloc function used by psql.exe - only the resulting pointer must be valid. And with the default linking methods, it *WILL* be different. Later, psql.exe tries to free() this string, at which point it crashes because the free() function can't find the allocated block (it's on the allocated blocks list used by the runtime lib of libpq.dll). Shouldn't the right thing to do be to have psql call termPQExpBuffer() on the data instead? As it is now, gets_fromFile() will just return the pointer received from the PQExpBuffer.data (this may well be present at several places - this is the one I was bitten by so far). Isn't that kind of "accessing the internals of the PQExpBuffer structure" wrong? Instead, perhaps it shuold make a copy of the string, adn then termPQExpBuffer() it? In that case, the string will have been allocated from within the same library as the free() is called. I can get it to work just fine by doing this - changing from (around line 100 of input.c): and the same a bit further down in the same function. But, as I said above, this may be at more places in the code? Perhaps someone more familiar to it could comment on that? What do you think shuld be done about this? Personally, I go by the "If you allocate a piece of memory using an interface, use the same interface to free it", but the question is how to make it work :-) Also, AFAIK this only affects psql.exe, so the changes made to the libpq this patch are required no matter how the other issue is handled. Regards, Magnus
2000-12-30Remove incorrect assert.Peter Eisentraut
2000-12-03Ensure that all uses of <ctype.h> functions are applied to unsigned-charTom Lane
values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
2000-11-27Pay attention to failure returns from fgets() in all cases.Tom Lane
Avoid infinite loop prompting for password at stdin EOF.
2000-11-26Silence warningPeter Eisentraut
2000-11-25Fix security problem with psql \e where temp file could be an existingBruce Momjian
symlink created by someone else, and therefore modifyable by someone else.
2000-11-13Remove -k unix socketpath option from client side, allow hostname withBruce Momjian
leading slash to behave as a unix socket path.
2000-11-13UUNET is looking into offering PostgreSQL as a part of a managed webBruce Momjian
hosting product, on both shared and dedicated machines. We currently offer Oracle and MySQL, and it would be a nice middle-ground. However, as shipped, PostgreSQL lacks the following features we need that MySQL has: 1. The ability to listen only on a particular IP address. Each hosting customer has their own IP address, on which all of their servers (http, ftp, real media, etc.) run. 2. The ability to place the Unix-domain socket in a mode 700 directory. This allows us to automatically create an empty database, with an empty DBA password, for new or upgrading customers without having to interactively set a DBA password and communicate it to (or from) the customer. This in turn cuts down our install and upgrade times. 3. The ability to connect to the Unix-domain socket from within a change-rooted environment. We run CGI programs chrooted to the user's home directory, which is another reason why we need to be able to specify where the Unix-domain socket is, instead of /tmp. 4. The ability to, if run as root, open a pid file in /var/run as root, and then setuid to the desired user. (mysqld -u can almost do this; I had to patch it, too). The patch below fixes problem 1-3. I plan to address #4, also, but haven't done so yet. These diffs are big enough that they should give the PG development team something to think about in the meantime :-) Also, I'm about to leave for 2 weeks' vacation, so I thought I'd get out what I have, which works (for the problems it tackles), now. With these changes, we can set up and run PostgreSQL with scripts the same way we can with apache or proftpd or mysql. In summary, this patch makes the following enhancements: 1. Adds an environment variable PGUNIXSOCKET, analogous to MYSQL_UNIX_PORT, and command line options -k --unix-socket to the relevant programs. 2. Adds a -h option to postmaster to set the hostname or IP address to listen on instead of the default INADDR_ANY. 3. Extends some library interfaces to support the above. 4. Fixes a few memory leaks in PQconnectdb(). The default behavior is unchanged from stock 7.0.2; if you don't use any of these new features, they don't change the operation. David J. MacKenzie
2000-09-17psql forgot to close connection before re-issuing password prompt.Peter Eisentraut
([BUGS] psql can crash the backend on login, 2000-09-03)
2000-07-17Don't strip trailing backslashes from a line. Treat them more reasonably.Peter Eisentraut
2000-06-26Fix \pset null to use ', not ".Bruce Momjian
2000-05-12Small cleanup of file.Bruce Momjian
2000-05-05psql: suppress warnings about too many arguments if the command is not valid ↵Peter Eisentraut
in the first place
2000-04-16squished \dS+ bug pointed out by Mike MascariPeter Eisentraut
2000-04-16more psql bug squashing:Peter Eisentraut
\copy without arguments failed commands with too many arguments were too silent
2000-04-14fixed another psql \e bug (handle newlines as whitespace)Peter Eisentraut
repaired psql option scanning bug (special treatment to \g |pipe) fixed ipcclean makefile made configure look for Perl to handle psql help build gracefully
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-04-11Clean up temp files from \e.Bruce Momjian
2000-03-27Fixed bug with repeated \e in psql (failed to clear buffers correctly)Peter Eisentraut
2000-03-18Fixed psql -c "\slashcmd"Peter Eisentraut
2000-03-01More fixes for psql ^C handling, especially during copy. Still doesn'tPeter Eisentraut
cope so well with copy to but that will have to wait for the next release. Also added -X option to prevent reading .psqlrc startup file.
2000-02-21Fixes for \encoding command.Tatsuo Ishii
1) freeing null pointer 2) invalid encoding info may be stored into psql variable 3) fix indentation
2000-02-20Moved psql \eset and \eshow to \encodingPeter Eisentraut
Improved psql's Ctrl-C handling Fixed configure test for sigsetjmp that now even recognizes it if it's a macro
2000-02-20Fix missing \n in some psql_error calls.Tom Lane
2000-02-19Add new backslash command \eset and \eshow.Tatsuo Ishii
2000-02-16Clean up include files use in psql.Bruce Momjian
2000-02-07Fixed psql double quoting of SQL idsPeter Eisentraut
Fixed libpq printing functions
2000-02-05Change function name PQclientencoding to PQclientEncoding sinceTatsuo Ishii
it seems more suitable for the naming convention in libpq.
2000-01-29A few minor psql enhancementsPeter Eisentraut
Initdb help correction Changed end/abort to commit/rollback and changed related notices Commented out way old printing functions in libpq Fixed a typo in alter table / alter column
2000-01-23updated install filePeter Eisentraut
updated date/time types doc fixed small psql bug removed libpq code that lower-cased db names make notice when long identifier is truncated
2000-01-22added ALTER TABLE DROP COLUMN, early versionPeter Eisentraut
2000-01-18another set of cleanupsPeter Eisentraut
2000-01-18Hi!Bruce Momjian
Here is a patch to bring both libpq and psql to a state where it compiles on win32 (native) again. A lot of things have changed, and I have not been able to keep up with them all, so it has been broken for quite a while. After this patch, at least it compiles. It also talks "basic talk" to the server, but I have not yet tested all things. Sending queries, and using e.g. \d or \dt works fine. The rest will have to be tested further. It also bumps the version on libpq.dll to 7.0. Everything should be enclosed in #ifdef WIN32, unless I have missed something. Except for one or maybe two places where I have moved a #include that should not be used on win32 from the "global area" into a "#ifndef WIN32 area". //Magnus
2000-01-15Adapt to the changes of libpq(eliminateing using putenv()).Tatsuo Ishii
2000-01-14Fixed psql variables vs array syntax, as well as minor psql enhancementsPeter Eisentraut
2000-01-12Fixed a few "fixes" and bugs. Adjusted messages and options to GNU suggestions.Peter Eisentraut