1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Use ISO dates in pgtypeslib by default.

Applied patch by Philip Yarra to fix some thread issues.
Added a new data type "decimal" which is mostly the same as our
	"numeric" but uses a fixed length array to store the digits. This is
	for compatibility with Informix and maybe others.
This commit is contained in:
Michael Meskes
2003-07-01 12:40:52 +00:00
parent f973b74583
commit 2bdd2e5dcf
18 changed files with 380 additions and 175 deletions

View File

@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/test/Makefile,v 1.37 2003/06/25 10:44:21 meskes Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/test/Makefile,v 1.38 2003/07/01 12:40:52 meskes Exp $
subdir = src/interfaces/ecpg/test
top_builddir = ../../../..
@ -22,7 +22,7 @@ test_informix: test_informix.o
$(ECPG) $<
test_informix.c: test_informix.pgc
$(ECPG) -C INFORMIX $<
$(ECPG) -C INFORMIX -r no_indicator $<
clean:
rm -f $(TESTS) $(TESTS:%=%.o) $(TESTS:%=%.c) log

View File

@ -18,16 +18,16 @@ main()
exec sql whenever sqlerror do sqlprint();
exec sql connect to mm;
exec sql create table test (text char(5), num decimal(14,7));
exec sql create table test (text char(5), num numeric(14,7));
value1 = PGTYPESnew();
value1 = PGTYPESnumeric_new();
PGTYPESnumeric_from_int(1407, value1);
text = PGTYPESnumeric_to_asc(value1, 0);
printf("long = %s\n", text);
value1 = PGTYPESnumeric_from_asc("2369.7", NULL);
value2 = PGTYPESnumeric_from_asc("10.0", NULL);
res = PGTYPESnew();
res = PGTYPESnumeric_new();
PGTYPESnumeric_add(value1, value2, res);
text = PGTYPESnumeric_to_asc(res, 0);
printf("add = %s\n", text);

View File

@ -5,7 +5,7 @@ void openit(void);
int main()
{
$int i = 14;
$decimal j;
$decimal j, m, n;
FILE *dbgs;
if ((dbgs = fopen("log", "w")) != NULL)
@ -41,7 +41,10 @@ int main()
}
}
$delete from test where i=87;
deccvint(7, &j);
deccvint(14, &m);
decadd(&j, &m, &n);
$delete from test where i=:n;
printf("delete: %ld\n", sqlca.sqlcode);
$commit;