Project

General

Profile

« Previous | Next » 

Revision 9087

lib/sh/db.sh: pg_export(): always include the LIMIT value if specified, rather than only if the caller did not provide a full query

View differences:

db.sh
71 71
{
72 72
	echo_func
73 73
	mk_table_esc
74
	local query="${query:-SELECT * FROM $table_esc ${limit:+LIMIT $limit }}"
75
	query="$(rtrim "$query")"
74
	local query="${query:-SELECT * FROM $table_esc}${limit:+ LIMIT $limit}"
76 75
	local pg_copy_format="${pg_copy_format-CSV HEADER}"
77 76
	
78 77
	psql "$@" <<<"COPY ($query) TO STDOUT $pg_copy_format;"

Also available in: Unified diff