aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg
Commit message (Collapse)AuthorAge
* Fix overflow check in tm2timestamp (this time for sure).Tom Lane2013-03-04
| | | | | | I fixed this code back in commit 841b4a2d5, but didn't think carefully enough about the behavior near zero, which meant it improperly rejected 1999-12-31 24:00:00. Per report from Magnus Hagander.
* Add support for piping COPY to/from an external program.Heikki Linnakangas2013-02-27
| | | | | | | | | | | | | | | | | | This includes backend "COPY TO/FROM PROGRAM '...'" syntax, and corresponding psql \copy syntax. Like with reading/writing files, the backend version is superuser-only, and in the psql version, the program is run in the client. In the passing, the psql \copy STDIN/STDOUT syntax is subtly changed: if you the stdin/stdout is quoted, it's now interpreted as a filename. For example, "\copy foo from 'stdin'" now reads from a file called 'stdin', not from standard input. Before this, there was no way to specify a filename called stdin, stdout, pstdin or pstdout. This creates a new function in pgport, wait_result_to_str(), which can be used to convert the exit status of a process, as returned by wait(3), to a human-readable string. Etsuro Fujita, reviewed by Amit Kapila.
* Remove the check for COPY TO STDIN and COPY FROM STDOUT from ecpg.Heikki Linnakangas2013-02-26
| | | | | | The backend grammar treats STDIN and STDOUT completely interchangeable, so that the above accepted. Arguably that was a mistake the backend grammar, but it's not ecpg's business to second guess that.
* Made ecpglib use translated messages.Michael Meskes2013-01-27
| | | | Bug reported and fixed by Chen Huajun <chenhj@cn.fujitsu.com>.
* Extend and improve use of EXTRA_REGRESS_OPTS.Andrew Dunstan2013-01-12
| | | | | | | | | | This is now used by ecpg tests, and not clobbered by pg_upgrade tests. This change won't affect anything that doesn't set this environment variable, but will enable the buildfarm to control exactly what port regression test installs will be running on, and thus to detect possible rogue postmasters more easily. Backpatch to release 9.2 where EXTRA_REGRESS_OPTS was first used.
* Update copyrights for 2013Bruce Momjian2013-01-01
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* Include isinf.o in libecpg if isinf() is not available on the system.Michael Meskes2012-12-04
| | | | Patch done by Jiang Guiqing <jianggq@cn.fujitsu.com>.
* When processing nested structure pointer variables ecpg always expected anMichael Meskes2012-11-29
| | | | | | array datatype which of course is wrong. Applied patch by Muhammad Usama <m.usama@gmail.com> to fix this.
* Suppress parallel build in interfaces/ecpg/preproc/.Tom Lane2012-11-28
| | | | | | | | | | | | | | This is to see if it will stop intermittent build failures on buildfarm member okapi. We know that gmake 3.82 has some problems with sometimes not honoring dependencies in parallel builds, and it seems likely that this is more of the same. Since the vast bulk of the work in the preproc directory is associated with creating preproc.c and then preproc.o, parallelism buys us hardly anything here anyway. Also, make both this .NOTPARALLEL and the one previously added in interfaces/ecpg/Makefile be conditional on "ifeq ($(MAKE_VERSION),3.82)". The known bug in gmake is fixed upstream and should not be present in 3.83 and up, and there's no reason to think it affects older releases.
* Applied patch by Chen Huajun <chenhj@cn.fujitsu.com> to make ecpg able to copeMichael Meskes2012-11-23
| | | | with very long structs.
* In our source code, make a copy of getopt's 'optarg' string arguments,Bruce Momjian2012-10-12
| | | | rather than just storing a pointer.
* Refactor flex and bison make rulesPeter Eisentraut2012-10-11
| | | | | | | | Numerous flex and bison make rules have appeared in the source tree over time, and they are all virtually identical, so we can replace them by pattern rules with some variables for customization. Users of pgxs will also be able to benefit from this.
* Quiet a few MSC compiler warnings.Andrew Dunstan2012-10-07
|
* Fixed test for array boundary.Michael Meskes2012-10-05
| | | | | | Instead of continuing if the next character is not an array boundary get_data() used to continue only on finding a boundary so it was not able to read any element after the first.
* Use .NOTPARALLEL in ecpg/Makefile to avoid a gmake parallelism bug.Tom Lane2012-09-09
| | | | | | | | | | | | | | | Investigation shows that some intermittent build failures in ecpg are the result of a gmake bug that was reported quite some time ago: http://savannah.gnu.org/bugs/?30653 Preventing parallel builds of the ecpg subdirectories seems to dodge the bug. Per yesterday's pgsql-hackers discussion, there are some other things in the subdirectory makefiles that seem rather unsafe for parallel builds too, but there's little point in fixing them as long as we have to work around a make bug. Back-patch to 9.1; parallel builds weren't very well supported before that anyway.
* Implement SQL-standard LATERAL subqueries.Tom Lane2012-08-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the standard syntax of LATERAL attached to a sub-SELECT in FROM, and also allows LATERAL attached to a function in FROM, since set-returning function calls are expected to be one of the principal use-cases. The main change here is a rewrite of the mechanism for keeping track of which relations are visible for column references while the FROM clause is being scanned. The parser "namespace" lists are no longer lists of bare RTEs, but are lists of ParseNamespaceItem structs, which carry an RTE pointer as well as some visibility-controlling flags. Aside from supporting LATERAL correctly, this lets us get rid of the ancient hacks that required rechecking subqueries and JOIN/ON and function-in-FROM expressions for invalid references after they were initially parsed. Invalid column references are now always correctly detected on sight. In passing, remove assorted parser error checks that are now dead code by virtue of our having gotten rid of add_missing_from, as well as some comments that are obsolete for the same reason. (It was mainly add_missing_from that caused so much fudging here in the first place.) The planner support for this feature is very minimal, and will be improved in future patches. It works well enough for testing purposes, though. catversion bump forced due to new field in RangeTblEntry.
* Remove unreachable codePeter Eisentraut2012-07-16
| | | | | | | The Solaris Studio compiler warns about these instances, unlike more mainstream compilers such as gcc. But manual inspection showed that the code is clearly not reachable, and we hope no worthy compiler will complain about removing this code.
* Run newly-configured perltidy script on Perl files.Bruce Momjian2012-07-04
| | | | Run on HEAD and 9.2.
* Replace int2/int4 in C code with int16/int32Peter Eisentraut2012-06-25
| | | | | | | | | | The latter was already the dominant use, and it's preferable because in C the convention is that intXX means XX bits. Therefore, allowing mixed use of int2, int4, int8, int16, int32 is obviously confusing. Remove the typedefs for int2 and int4 for now. They don't seem to be widely used outside of the PostgreSQL source tree, and the few uses can probably be cleaned up by the time this ships.
* Make documentation of --help and --version options more consistentPeter Eisentraut2012-06-18
| | | | | | Before, some places didn't document the short options (-? and -V), some documented both, some documented nothing, and they were listed in various orders. Now this is hopefully more consistent and complete.
* Stamp library minor versions for 9.3.Tom Lane2012-06-13
| | | | | | This includes fixing the MSVC copy of ecpg/preproc's version info, which seems to have been overlooked repeatedly. Can't we fix that so there are not two copies??
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-10
| | | | commit-fest.
* Lots of doc corrections.Robert Haas2012-04-23
| | | | Josh Kupershmidt
* Stamp libraries versions for 9.2 (better late than never).Bruce Momjian2012-04-07
|
* Rename frontend keyword arrays to avoid conflict with backend.Tom Lane2012-03-31
| | | | | | | | | | | | | ecpg and pg_dump each contain keyword arrays with structure similar to the backend's keyword array. Up to now, we actually named those arrays the same as the backend's and relied on parser/keywords.h to declare them. This seems a tad too cute, though, and it breaks now that we need to PGDLLIMPORT-decorate the backend symbols. Rename to avoid the problem. Per buildfarm. (It strikes me that maybe we should get rid of the separate keywords.c files altogether, and just define these arrays in the modules that use them, but that's a rather more invasive change.)
* Add const qualifier to tzn returned by timestamp2tm()Peter Eisentraut2012-03-15
| | | | | The tzn value might come from tm->tm_zone, which libc declares as const, so it's prudent that the upper layers know about this as well.
* Improve EncodeDateTime and EncodeTimeOnly APIsPeter Eisentraut2012-03-14
| | | | | Use an explicit argument to tell whether to include the time zone in the output, rather than using some undocumented pointer magic.
* Add missing va_end() callsPeter Eisentraut2012-03-14
| | | | found by Coverity
* ecpg: Fix off-by-one error in memory copyingPeter Eisentraut2012-03-08
| | | | | | | In a rare case, one byte past the end of memory belonging to the sqlca_t structure would be written to. found by Coverity
* ecpg: Fix rare memory leaksPeter Eisentraut2012-03-08
| | | | found by Coverity
* ecpg: Clean up some const usagePeter Eisentraut2012-03-02
|
* In ecpglib rewrote code that used strtok_r to not use library functionsMichael Meskes2012-02-19
| | | | | anymore. This way we don't have to worry which compiler on which OS offers which version of strtok.
* gcc on Windows does not know about strtok_s.Michael Meskes2012-02-18
|
* Windows doesn't have strtok_r, so let's use strtok_s instead.Michael Meskes2012-02-18
|
* Make sure all connection paramters are used in call to PQconnectdbParams.Michael Meskes2012-02-18
|
* Do not use the variable name when defining a varchar structure in ecpg.Michael Meskes2012-02-13
| | | | With a unique counter being added anyway, there is no need anymore to have the variable name listed, too.
* Allow the connection keyword array to carry all seven items in ecpglib.Michael Meskes2012-02-06
|
* Applied Peter's patch to PQconnectdbParams in ecpglib instead of the oldMichael Meskes2012-02-04
| | | | PQconectdb.
* ecpg: Improve test buildingPeter Eisentraut2012-02-02
| | | | | | | | | Further improve on commit c75e1436467f32a06b5ab9d594d2a390e7f4594d. Instead of building both .o files and binaries in the same make rule, just rely on the normal .c -> .o rule. This will ensure that dependency tracking is used when enabled. To do this, disable the implicit direct .c -> binary rule globally, which will also prevent the original problem (*.dSYM junk) from reappearing elsewhere.
* Ecpglib stores variables that are used in DECLARE statements in a global list.Michael Meskes2012-01-05
| | | | | | This list is now freed when the last connection has been closed. Closes: #6366
* Made code in ecpg better readable.Michael Meskes2012-01-04
|
* pg_regress: Replace exit_nicely() with exit() plus atexit() hookPeter Eisentraut2012-01-02
|
* Update copyright notices for year 2012.Bruce Momjian2012-01-01
|
* Standardize treatment of strcmp() return valuePeter Eisentraut2011-12-27
| | | | | Always compare the return value to 0, don't use cute tricks like if (!strcmp(...)).
* Mark variables as const in pgtypeslib if they only carry a format string.Michael Meskes2011-12-18
|
* Added test for cursor handling on different connections to regression testMichael Meskes2011-12-18
| | | | suite for ecpg.
* In ecpg removed old leftover check for given connection name.Michael Meskes2011-12-18
| | | | | | | | Ever since we introduced real prepared statements this should work for different connections. The old solution just emulating prepared statements, though, wasn't able to handle this. Closes: #6309
* Miscellaneous cleanup to silence compiler warnings seen on Mingw.Andrew Dunstan2011-12-10
| | | | | Remove some dead code, conditionally declare some items or call some code, and fix one or two declarations.
* Enable compiling with the mingw-w64 32 bit compiler.Andrew Dunstan2011-12-10
| | | | | | | Original patch by Lars Kanis, reviewed by Nishiyama Tomoaki and tweaked some by me. This compiler, or at least the latest version of it, is currently broken, and only passes the regression tests if built with -O0.
* Applied another patch by Zoltan to fix memory alignement issues in ecpg's sqldaMichael Meskes2011-12-04
| | | | code.