mirror of https://github.com/postgres/postgres
parent
d9e4966be1
commit
7ff8a18030
@ -1,22 +1,17 @@ |
||||
all: test1 test2 test3 perftest |
||||
all: test1 test2 test3 test4 perftest |
||||
|
||||
LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq -lcrypt
|
||||
|
||||
test1: test1.c |
||||
test1.c: test1.pgc |
||||
/usr/local/pgsql/bin/ecpg $?
|
||||
.SUFFIXES: .pgc .c |
||||
|
||||
test1: test1.c |
||||
test2: test2.c |
||||
test2.c: test2.pgc |
||||
/usr/local/pgsql/bin/ecpg $?
|
||||
|
||||
test3: test3.c |
||||
test3.c: test3.pgc |
||||
/usr/local/pgsql/bin/ecpg $?
|
||||
|
||||
test4: test4.c |
||||
perftest: perftest.c |
||||
perftest.c:perftest.pgc |
||||
|
||||
.pgc.c: |
||||
/usr/local/pgsql/bin/ecpg $?
|
||||
|
||||
clean: |
||||
-/bin/rm test1 test2 test3 perftest *.c log
|
||||
-/bin/rm test1 test2 test3 test4 perftest *.c log
|
||||
|
||||
@ -1,19 +1,16 @@ |
||||
exec sql include sqlca; |
||||
|
||||
exec sql whenever sqlerror |
||||
do |
||||
PrintAndStop(); |
||||
exec sql whenever sqlwarning |
||||
do |
||||
warn(); |
||||
exec sql whenever sqlerror do PrintAndStop(msg); |
||||
exec sql whenever sqlwarning do warn(); |
||||
|
||||
void PrintAndStop(void) |
||||
void PrintAndStop(msg) |
||||
{ |
||||
fprintf(stderr, "Error in statement '%s':\n", msg); |
||||
sqlprint(); |
||||
exit(-1); |
||||
} |
||||
|
||||
void warn(void) |
||||
void warn(void) |
||||
{ |
||||
fprintf(stderr, "Warning: At least one column was truncated\n"); |
||||
} |
||||
|
||||
Loading…
Reference in new issue