Commit Graph

2261 Commits

Author SHA1 Message Date
Bruce Momjian 8101d0c571 Makefile CFLAGS cleanups. 2000-05-11 17:46:35 +00:00
Tom Lane b45f3a6e5b Forgot that dumpall's output script should 'delete from pg_group' before
loading new data, for consistency with its handling of pg_shadow.
2000-05-05 17:50:38 +00:00
Tom Lane 3a69c316cc Accept pg_group as well as pg_shadow data from dumpall script.
Rearrange handling of VACUUMs so that they are certain to be executed
as superuser not some random user; also, do not forget to vacuum
template1 itself.
2000-05-05 03:08:20 +00:00
Tom Lane 3d1461802e Dump contents of pg_group along with pg_shadow. 2000-05-05 03:04:00 +00:00
Tom Lane 07d2c3e0a0 Another static-vs-not-static error. 2000-04-14 01:34:24 +00:00
Bruce Momjian 52f77df613 Ye-old pgindent run. Same 4-space tabs. 2000-04-12 17:17:23 +00:00
Tom Lane c84ba6638e Add a check to pg_dump to see whether backend is same version as pg_dump.
If not, abort by default.  Abort can be prevented by using -i or
--ignore-version switch.
2000-04-04 05:22:46 +00:00
Bruce Momjian d825e55c13 Update pg_dumpall again. 2000-03-22 05:25:06 +00:00
Bruce Momjian 233a52eaff Fix pg_dumpall for new psql output. 2000-03-22 05:10:22 +00:00
Bruce Momjian 52d0265736 it seems in the beta2 release DBUSERID in pg_dumpall is the _name_ of the
user, so it doesn't need to be translated from the number to the name.

also ``create database ...'' does not take numbers for the encoding, so
the ENCODING variable does not need to be translated to a number, but left
as the text representation.  a patch is supplied to make the changes i
have found to work.  i was successful dumping and reloading my database
after these changes.
-

John M. Flinchbaugh
2000-03-19 02:19:43 +00:00
Bruce Momjian f43ec05d05 I've made a diff against the 7.0beta1 tree that accomplishes several things:
1) adds NetBSD shared lib support on both ELF and a.out platforms

        2) replaces "-L$(LIBPQDIR) -lpq" with "$(LIBPQ)" defined in
           Makefile.global.  This makes it much easier to build stuff in
           the source tree after you've already installed the libraries.

        3) adds TEMPLATEDIR in Makefile.global that indicates where the
           database templates are stored.  This separates the template files
           from real libraries that are installed in $(LIBDIR).
        4) changes include order of <readline/readline.h> and <readline.h>.
           The latest GNU readline installs its headers under a readline
           subdirectory.

In addition to applying the patch below the following files need to be copied:

        backend/port/dynloader:
                bsd.h -> netbsd.h
                bsd.c -> netbsd.c
        include/port:
                bsd.h -> netbsd.h
        makefiles:
                Makefile.bsd -> Makefile.netbsd

It would be great to see this incorporated into the source tree before
the 7.0 release is cut.

        Thanks!

     -- Johnny C. Lam <lamj@stat.cmu.edu>
2000-03-08 01:58:46 +00:00
Bruce Momjian 91124a2f66 Fix problems with pg_upgrade found by Kardos, Dr. Andrea 2000-03-07 23:09:34 +00:00
Bruce Momjian c969e2662f 1. miscadmin.h needs to include sys/types.h for a definition of pid_t
2. Regression tests fail for types int2 and int4 (which can easily be
fixed by adding entries to resultmap) aswell as float8 and geometry,
where floating point numbers appear to be rounded a little differently
than in your expected results (besides that I also need the positive
zeros file). I'm including a patch for the first 2, but I don't know
whether the latter two are actually a bug in postgres or a bug in the
OS or even allowed difference. I'm including my results for reference.

Rolf Grossmann
2000-02-23 15:46:15 +00:00
Bruce Momjian a52692213c README not needed anymore. 2000-02-16 21:26:00 +00:00
Jan Wieck f1acd900ad Disable/reenable triggers for data only dump.
Jan
2000-02-07 16:30:58 +00:00
Jan Wieck ddd596d386 Added ALTER TABLE ... ADD CONSTRAINT (provided by Stephan Szabo).
Added constraint dumping capability to pg_dump (also from Stephan)

Fixed DROP TABLE -> RelationBuildTriggers: 2 record(s) not found for rel
error.

Fixed little error in gram.y I made the last days.

Jan
2000-02-04 18:49:34 +00:00
Peter Eisentraut 2ea31fabe7 *** empty log message *** 2000-02-02 13:20:15 +00:00
Peter Eisentraut 2b84cbb60f A few minor psql enhancements
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-29 16:58:54 +00:00
Bruce Momjian 3f0074e403 fix for compile. 2000-01-27 05:33:51 +00:00
Bruce Momjian 5c25d60244 Add:
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc

to all files copyright Regents of Berkeley.  Man, that's a lot of files.
2000-01-26 05:58:53 +00:00
Peter Eisentraut bdb41ad0e7 Made abstime/reltime use int4 instead of time_t (TODO item)
Made type equivalency apply to aggregates (TODO item)
Fixed parsing bug in psql
Reverted some stupid options changes I made to pg_dump
2000-01-24 19:34:19 +00:00
Bruce Momjian 2317e714c8 Update pg_dumpall. 2000-01-19 20:10:27 +00:00
Peter Eisentraut 65e0051843 another round of user interface cleanups
removed pg_id
fixed a few bugs in the scripts
2000-01-19 20:08:36 +00:00
Peter Eisentraut 533d516629 Removed MBFLAGS from makefiles since it's now done in include/config.h. 2000-01-19 02:59:03 +00:00
Bruce Momjian 2eebcddeaa Bruce,
Attached is a patch which patches cleanly against the Sunday afternoon
snapshot. It modifies pg_dump to dump COMMENT ON statements for
user-definable descriptions. In addition, it also modifies comment.c so
that the operator behavior is as Peter E. would like: a comment on an
operator is applied to the underlying function.

Thanks,

Mike Mascari
2000-01-18 18:09:02 +00:00
Tom Lane 4cd086ce43 Fix quoting bugs and incorrect trigger argument printout. 2000-01-18 07:29:58 +00:00
Peter Eisentraut 28125ed5e0 Updated user interfaces on initdb, initlocation, pg_dump, ipcclean to a GNU-compliant'ish state.
Made ipcclean work on Linux.
2000-01-18 00:03:37 +00:00
Tom Lane 97e82dc72c Clean up pg_dump coredumps caused by change of output formatting for
oidvector/int2vector.  pg_dump code was assuming that it would see
exactly FUNC_MAX_ARGS integers in the string returned by the backend.
That's no longer true.  (Perhaps that change wasn't such a good idea
after all --- will it break any other applications??)
2000-01-16 03:54:58 +00:00
Bruce Momjian 8a093d0ae3 Make number of args to a function configurable. 2000-01-10 17:14:46 +00:00
Bruce Momjian 6456b17bc1 Rename oid8 -> oidvector and int28 -> int2vector. Cleanup of *out functions. 2000-01-10 16:13:23 +00:00
Bruce Momjian 5633e22e2c Update pg_dumpall for new psql format. 2000-01-06 21:16:18 +00:00
Bruce Momjian e9bfedc9bc Fix length limit, MikeA 1999-12-27 18:21:07 +00:00
Bruce Momjian 635498623d Hi, all,
This is the patch for the final bit.  Sorry that it's separate.

Cheers...


MikeA
1999-12-27 15:45:04 +00:00
Bruce Momjian 24a0f021ef Hi, all
I finally got around to schlepping through pg_dump, to finish what I started
about three months (or more) ago.  Attached is a gzipped diff file to apply
in the bin/pg_dump directory.  This should remove all string length
dependencies, except one, which I'm working on.  It has been through some
rudimentary unit testing, but that's about it, so if any of you would give
it a more strenuous run-through, I'd be grateful for the feedback.

Cheers...

 Ansley, Michael
1999-12-27 15:42:44 +00:00
Bruce Momjian 5ca971a18a Hi,
I sending promised patch with:

        * getopt_long() - for pg_dump (portable)

        * and "Usage: " changes in scripts in src/bin/
          - this changes are cosmetic only, not change any
          feature ...etc.

 All PostgreSQL routines (scripts) support now long options and
help's output is alike for all scripts and all support -? or --help.

                                                Karel

Karel Zak <zakkr@zf.jcu.cz>              http://home.zf.jcu.cz/~zakkr/
1999-12-16 20:10:02 +00:00
Bruce Momjian e639a1a6a8 This takes care of TODO item
* pg_dump should preserve primary key information

Also a couple of warnings removed.

--
Peter Eisentraut                  Sernanders väg 10:115
1999-12-11 00:31:05 +00:00
Bruce Momjian fc955b14ea Add system indexes to match all caches.
Make all system indexes unique.
Make all cache loads use system indexes.
Rename *rel to *relid in inheritance tables.
Rename cache names to be clearer.
1999-11-22 17:56:41 +00:00
Tom Lane ecd0bfa81a Look Ma, no MAX_PARSE_BUFFER! (At least not in the backend.
pg_dump and interfaces/odbc still need some work.)
1999-10-23 03:13:33 +00:00
Bruce Momjian 65a2c8f5b8 Improve pg_dump template1 error reports. 1999-10-10 17:00:26 +00:00
Bruce Momjian 944dec1ff0 Improve pg_dump template1 error message. 1999-10-10 14:42:44 +00:00
Bruce Momjian 692b83730b Fix pg_upgrade so it vacuums all databases. 1999-09-28 18:04:18 +00:00
Bruce Momjian 1e821d05f2 pg_upgrade reminder. 1999-09-28 16:02:28 +00:00
Bruce Momjian f66393514f One last missing quoting bug in pg_dump:
now that sequence names are properly quoted for field defaults, mixed
case sequence names are generated. These are properly quoted in the
CREATE SEQUENCE lines, but not in the SELECT nextval lines, as per
below:

CREATE SEQUENCE "Teams_TeamID_seq" start 10 increment 1 maxvalue
2147483647 minvalue 1  cache 1 ;
SELECT nextval ('Teams_TeamID_seq');

This needs to be:
SELECT nextval ('"Teams_TeamID_seq"');

Patch included below.
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
1999-09-23 19:11:09 +00:00
Bruce Momjian 4478d299e1 Document -x properly for pg_dump. 1999-09-01 23:05:20 +00:00
Tom Lane b0984e6995 Add a VACUUM command in hopes of making pg_upgrade usable again
in MVCC environment.  I do not trust this until Vadim says it's OK...
1999-08-02 22:34:53 +00:00
Tom Lane 970ef45c41 Re-enable pg_upgrade, after adding checks that the source
and target databases are of versions it knows about.
1999-07-31 22:06:44 +00:00
Bruce Momjian e44c931801 Re-add getopt.h check, remove NT-specific tests for it. 1999-07-19 02:27:16 +00:00
Bruce Momjian 3406901a29 Move some system includes into c.h, and remove duplicates. 1999-07-17 20:18:55 +00:00
Bruce Momjian 4b2c2850bf Clean up #include in /include directory. Add scripts for checking includes. 1999-07-15 15:21:54 +00:00
Bruce Momjian 61882d4c37 Cleanup 1999-06-08 01:37:55 +00:00
Bruce Momjian f56483490b Disable pg_upgrade for 6.5. 1999-06-08 01:32:05 +00:00
Bruce Momjian 505b2ecdf4 I attach a patch for pg_upgrade. This does two things:
1. check whether the program is being executed in $PGDATA/..  This is
   necessary if the data tree is not in the standard place, as is the
   case with the Debian distribution (because of Debian policy).

2. give a clearer error message if the dumped data structure fails to
   be loaded.

Oliver Elphick
1999-06-07 22:58:31 +00:00
Tom Lane 58d8584eea pg_dump failed on any database containing large objects,
because it ignored the LOs themselves but failed to ignore the indexes
on the LOs.  How long has this been broken??
1999-06-03 04:01:16 +00:00
Vadim B. Mikheev df9e539ea2 1. Run all pg_dump queries in single serializable transaction.
2. Get rid of locking when updating statistics in vacuum.
3. Use QuerySnapshot in COPY TO and call SetQuerySnashot
   in main tcop loop before FETCH and COPY TO.
1999-05-29 10:25:33 +00:00
Bruce Momjian 615e77ede2 Make pg_dump dump ACL's by default, print warning on use of -z, and add
new -x option to skip acl dump.
1999-05-27 16:29:05 +00:00
Tom Lane 8eb18d874e Fix pg_dump to use the same maximum-query-size constant as
the backend does.  Remove unnecessary limitation on field size in
dumpClasses_dumpData (ie, -d or -D case).
1999-05-26 21:51:13 +00:00
Bruce Momjian e7528612d8 Allow GROUPs to be dumped properly. 1999-05-26 19:45:53 +00:00
Bruce Momjian 9b35ec2615 Disable use of -o and -d pg_dump options together. Can't set oids in
inserts.  Change some variables to bool to be clearer.
1999-05-26 16:06:45 +00:00
Bruce Momjian eeadc5e87f Allow pg_dump -v display proper table/sequence count display. 1999-05-26 14:50:38 +00:00
Bruce Momjian 07842084fe pgindent run over code. 1999-05-25 16:15:34 +00:00
Bruce Momjian de81fbd047 I've got 2 pretty small patches.
configtype.patch simply fixes a typo in config.h.in
pg_dump.c.patch Updates a bunch of error messages to include a reason
from
                the backend, and also removes a couple of unnecessary
if's

Ole Gjerde
1999-05-15 22:18:51 +00:00
Bruce Momjian 519ad246ae Here's a small patch to cause pg_dump to emit the
scale and precision for NUMERIC type column defs.

Keith Parks
1999-05-13 02:35:44 +00:00
Bruce Momjian 4853495e03 Change error messages to oids come out as %u and not %d. Change has no
real affect now.
1999-05-10 00:46:32 +00:00
Thomas G. Lockhart 54067db642 Allow -t tablename to preserve case if specified as "tablename". 1999-05-04 15:47:35 +00:00
Tom Lane faba9fa747 pg_dump was trying to use an incorrect (or, perhaps, only obsolete?)
syntax for CREATE OPERATOR with SORT parameters.  Fixed.
It is now actually possible to dump and reload a database containing
fully specified user-definable operators ...
1999-04-14 23:47:19 +00:00
Bruce Momjian 6724a50787 Change my-function-name-- to my_function_name, and optimizer renames. 1999-02-13 23:22:53 +00:00
Tom Lane 07c33ba79e pg_dump -d or -D didn't quote special characters in INSERT data
correctly.  -D had problems with tables with inherited fields, also.
1999-02-08 01:46:28 +00:00
Bruce Momjian 289a826dab Here is a new version of my patch for allowing pg_dump to DROP schema
elements prior to CREATEing new ones.  It is under control of the -c
command line option (with the default being status quo).

The DROP TRIGGER portion still needs implementation.  Anyone able to
help clarify what exactly the CREATE TRIGGER portion does so I can fix
this?

Again, I have tried this with tables/indexes/sequences, but do not
have other schema elements in my database.  As a result, I am not 100%
convinced that I got the syntax correct in all cases (but think I did,
nonetheless).  If anyone can check the other cases, I'd appreciate it.

Cheers,
Brook

[I added manual page and sgml additions for the new -c option.]
1999-01-21 22:53:37 +00:00
Bruce Momjian fd7b963316 Fix for typo in gram.y 1999-01-18 06:32:27 +00:00
Bruce Momjian 7a6b562fdf Apply Win32 patch from Horak Daniel. 1999-01-17 06:20:06 +00:00
Thomas G. Lockhart e18d900da4 Adjust handling of data type names to suppress double quotes
unless necessary.
Label internal bpchar types as "character" and varchar types as
 "character varying" to be less Postgres-specific. These types map to
 the SQL92 definitions anyway.
Redefine g_force_quotes to be the local variable force_quotes.
Pass this as an argument to fmtId().
These should help with handling the single-byte internal "char" type.
1998-12-13 23:41:32 +00:00
Bruce Momjian 5c431eb1f2 Included patches should fix following problems in the muti-byte
enabled PostgreSQL 6.4.

o binary cursor does not work
o pg_dumpall produces incorrect create database statemnt

Tatsuo Ishii
t-ishii@sra.co.jp
1998-12-12 22:04:09 +00:00
Tom Lane 84107b419e Fix coredumping bug in pg_dump -z; also eliminate memory leaks
in the ACL code, and spell "GRANT RULE" correctly.
Apply patch from Oliver Elphick to not dump inherited constraints.
Apply patch from Constantin Teodorescu to dump table definitions with a
readable layout.
1998-12-05 22:09:57 +00:00
Tom Lane 0856cdf3f7 Fix a couple of bugs involving calling fmtID() twice in
a single printf() ... it'd work if fmtId() didn't use a static return area...
1998-11-15 07:09:13 +00:00
Thomas G. Lockhart 680e4a2950 Add "-N" flag to force double quotes around identifiers.
This is the default, but the new flag will allow overriding an alias,
 for example. So psql -n -N will put in the double quotes,
 and psql -n can be an alias for psql.
Also, add a few braces around a nested single-line conditional construct
 to suppress compiler warnings about "an ambiguous else".
1998-11-06 15:54:47 +00:00
Tom Lane 990fa43c23 Get rid of some minor compiler warnings. 1998-10-26 01:05:07 +00:00
Bruce Momjian d79f3884f4 cleanup 1998-10-25 02:48:55 +00:00
Bruce Momjian ba74ce73bb Fix from Tom Lane for pg_shadow in pg_upgrade 1998-10-25 02:47:38 +00:00
Tom Lane a7cdfdf022 Fix pg_upgrade to notice if psql fails to execute the given
script, and not proceed with the update if so.
Also add #!/bin/sh header line.
1998-10-24 20:09:46 +00:00
Bruce Momjian b0dfc47794 2) Can't dump/restore varchar fields (See attached bug report/patch)
Cary B. O'Brien
1998-10-12 02:05:42 +00:00
Bruce Momjian 803204bd1e Playing around with pg_dump for a while resulted in some
fixes,  enhancements and some found bugs not yet fixed. After
    all I was able to get useful results  when  dumping/reloading
    the regression database.

Jan
1998-10-06 22:14:21 +00:00
Thomas G. Lockhart b53d36618f Forgot to initialize double quote option to be enabled. 1998-10-06 05:35:42 +00:00
Bruce Momjian b7ed6f8512 Hi all
Is it too late to add a feature to pg_dump for 6.4??

I just spent most of the day learning pg_dump and modifing it so it
would
dump views also.

This is the first time I have ever contributed any code changes, so I'm
not sure of how to submit it.

The diff's and a readme as a tgz file are attached.

Thanks
Terry Mackintosh <terry@terrym.com>          http://www.terrym.com
1998-10-06 03:09:02 +00:00
Thomas G. Lockhart 9601964773 Surround all identifiers with double quotes.
Formerly did so only for those which clearly required it, but that
 would still miss things like reserved key words which also require it.
Implement the "-n" switch to revert the double quote behavior
 to put DQs only where there is more than lower-case, digits,
 and underscores.
1998-10-02 16:43:41 +00:00
Tom Lane 0d1aa5ac52 pg_dump -z was careless about ownership of indexes.
Now it's a little less so.
1998-10-01 01:49:12 +00:00
Bruce Momjian b932b1b1c4 Allow 8-key indexes. 1998-09-23 04:22:14 +00:00
Bruce Momjian 3ac9688ae8 I also noticed that pg_dump contains a copy of the same
prompt_for_password code that psql does.  We fixed psql a month or
two back to permit usernames and passwords longer than 8 characters.
I propagated the same fix into pg_dump.

Tom Lane
1998-09-20 03:18:43 +00:00
Bruce Momjian f71d0cf64e Attached is a patch to remove the definitions of libpq's internal
structs from libpq-fe.h, as we previously discussed.

There turned out to be sloppy coding practices in more places than
I had realized :-(, but all in all I think it was a well-worth-while
exercise.

I ended up adding several routines to libpq's API in order to respond
to application requirements that were exposed by this work.  I owe the
docs crew updates for libpq.sgml to describe these changes.  I'm way too
tired to work on the docs tonight, however.

This is the last major change I intend to submit for 6.4.  I do want
to see if I can make libpgtcl work with Tcl 8.0 before we go final,
but hopefully that will be a minor bug fix.
1998-09-03 02:10:56 +00:00
Bruce Momjian fa1a8d6a97 OK, folks, here is the pgindent output. 1998-09-01 04:40:42 +00:00
Bruce Momjian af74855a60 Renaming cleanup, no pgindent yet. 1998-09-01 03:29:17 +00:00
Bruce Momjian 2913d6557e Preserver pg_log and pg_variable in upgrade. Cleanups. 1998-08-31 04:32:18 +00:00
Bruce Momjian 3b7d13a6b0 Make old db directory configurable. 1998-08-30 13:14:00 +00:00
Bruce Momjian c870be6590 New pg_upgrade command. 1998-08-30 05:06:54 +00:00
Bruce Momjian 88800aac14 Ok. BTW Mr. Kataoka who is maintaing Japanese version of PostgreSQL
ODBC driver have found a bug in 6.3.2 pg_dump and have made patches.
I confirmed that the same bug still exists in the current source
tree. So I made up patches based on Kataoka's. Here are some
explanations.

o fmtId() returns pointer to a static memory in it. In the meantime
there is a line where is fmtId() called twice without saving the
first value returned by fmtId(). So second call to fmtId() will
break the first one.

o findTableByName() looks up a table by its name. if a table name
contanins upper letters or non ascii chars, fmtId() will returns
a name quoted in double quotes, which will not what findTableByName()
wants. The result is SEG fault.  -- Tatsuo Ishii t-ishii@sra.co.jp
1998-08-29 18:06:57 +00:00
Thomas G. Lockhart 6962f86e74 Clean up double-quotes around column and table names.
Had too many in some cases because there was already a routine
 taking care of it.
1998-08-25 15:02:04 +00:00
Bruce Momjian c0b01461db o note that now pg_database has a new attribuite "encoding" even
if MULTIBYTE is not enabled. So be sure to run initdb.

o these patches are made against the latest source tree (after
Bruce's massive patch, I think) BTW, I noticed that after running
regression, the oid field of pg_type seems disappeared.

	regression=> select oid from pg_type; ERROR:  attribute
	'oid' not found

this happens after the constraints test. This occures with/without
my patches. strange...

o pg_database_mb.h, pg_class_mb.h, pg_attribute_mb.h are no longer
used, and shoud be removed.

o GetDatabaseInfo() in utils/misc/database.c removed (actually in
#ifdef 0). seems nobody uses.

t-ishii@sra.co.jp
1998-08-24 01:14:24 +00:00
Bruce Momjian af5fde7491 Make large objects their own relkind type. Fix dups in pg_class_mb
files.  Fix sequence creation hack for relkind type.
1998-08-06 05:13:14 +00:00
Bruce Momjian 916710fc91 pg_dump -z has gotten rather thoroughly broken in the last couple
of days --- it was emitting stuff like
	REVOKE ALL on 'table' from PUBLIC; GRANT ALL on "table" to
	"Public"; neither of which work.  While I was at it I
cleaned up a few other things:

* \connect commands are issued only in -z mode.  In this way,
reloading a pg_dump script made without -z will generate a simple
database wholly owned by the invoking user, rather than a mishmash
of tables owned by various people but lacking in access rights.
(Analogy: cp versus cp -p.)

* \connect commands are issued just before COPY FROM stdin commands;
without this, reloading a database containing non-world-writable
tables tended to fail because the COPY was not necessarily attempted
as the table owner.

* Redundant \connect commands are suppressed (each one costs a
backend launch, so...).

* Man page updated (-z wasn't ever documented).

The first two items were discussed in a pgsql-hackers thread around
6 May 98 ("An item for the TODO list: pg_dump and multiple table
owners") but no one had bothered to deal with 'em yet.

			regards, tom lane
1998-07-19 05:24:51 +00:00
Marc G. Fournier 3a3c1b85a3 From: Tom Lane <tgl@sss.pgh.pa.us>
I see someone missed an ancient bit of shell-scripting lore:
on some older shells, if your script's argument list is empty,
then "$@" generates an empty-string word rather than no word
at all.  You need to write ${1+"$@"} to get the latter behavior.
(Read your shell man page to see exactly how that works,
but it does the Right Thing on every Bourne shell.)

In particular, pg_dumpall fails when invoked without any switches
on HPUX 9.*, because pg_dump gets an empty-string argument that it
thinks is the name of the database to dump.  I expect this bug
also affects some other OSes, but couldn't tell you just which ones.
Patch attached.
1998-07-09 03:35:39 +00:00
Thomas G. Lockhart 8bf61820f0 Surround table and column names with double-quotes
in generated SQL code to preserve case (SQL92 syntax).
1998-07-08 14:33:19 +00:00
Bruce Momjian 454913c19a Remove -c option for Constraint syntax so we us it by default. 1998-06-20 02:49:38 +00:00
Bruce Momjian 8ed5918faa Solaris cleanup. 1998-06-19 02:55:19 +00:00
Bruce Momjian cb7cbc16fa Hi, here are the patches to enhance existing MB handling. This time
I have implemented a framework of encoding translation between the
backend and the frontend. Also I have added a new variable setting
command:

SET CLIENT_ENCODING TO 'encoding';

Other features include:
	Latin1 support more 8 bit cleaness

See doc/README.mb for more details. Note that the pacthes are
against May 30 snapshot.

Tatsuo Ishii
1998-06-16 07:29:54 +00:00
Bruce Momjian 32eef5ad1e I've hacked up pg_dump so that it generates CONSTRAINT and CHECK
syntax that can be read back in with psql.  I did this by adding
a
 "-c" switch that controls moving the CONTSTRAINT statements inside
the CREATE TABLE statements and adding () around the CHECK arguments.
Here's diffs against the 6.3.2 version of pg_dump.c.

ccb
1998-06-16 06:52:15 +00:00
Bruce Momjian 6bd323c6b3 Remove un-needed braces around single statements. 1998-06-15 19:30:31 +00:00
Bruce Momjian 1c2d9cb637 It seems the regression tests don't cover copy in/out at all, so
code that I had assumed was working had not been tested.  Naturally,
it was broken ...

Tom Lane
1998-05-06 23:53:48 +00:00
Bruce Momjian bf7b72109f Re-add pg_dump fix. 1998-04-07 22:36:38 +00:00
Bruce Momjian e83621aa13 Reverse out pg_dump changes. 1998-04-07 22:00:37 +00:00
Bruce Momjian 6a3c751448 Fix for ACL's from Thomas A. Szybist. 1998-04-07 16:41:11 +00:00
Bruce Momjian 471dbbc223 DESTDIR removed, again. 1998-04-06 16:53:15 +00:00
Bruce Momjian 5523beb949 Re-introduce $DISTDIR. 1998-04-06 01:16:55 +00:00
Bruce Momjian 1e801a8f16 Hi,
Attached you'll find a (big) patch that fixes make dep and make
depend in all Makefiles where I found it to be appropriate.

It also removes the dependency in Makefile.global for NAMEDATALEN
and OIDNAMELEN by making backend/catalog/genbki.sh and bin/initdb/initdb.sh
a little smarter.

This no longer requires initdb.sh that is turned into initdb with
a sed script when installing Postgres, hence initdb.sh should be
renamed to initdb (after the patch has been applied :-) )

This patch is against the 6.3 sources, as it took a while to
complete.

Please review and apply,

Cheers,

Jeroen van Vianen
1998-04-06 00:32:26 +00:00
Bruce Momjian 2dfee93457 Remove DISTDIR. 1998-04-05 22:02:56 +00:00
Bruce Momjian 9a0dd4fb18 There's a patch attached to fix gcc 2.8.x warnings, except for the
yyerror ones from bison. It also includes a few 'enhancements' to
the C programming style (which are, of course, personal).

The other patch removes the compilation of backend/lib/qsort.c, as
qsort() is a standard function in stdlib.h and can be used any
where else (and it is). It was only used in
backend/optimizer/geqo/geqo_pool.c, backend/optimizer/path/predmig.c,
and backend/storage/page/bufpage.c

> > Some or all of these changes might not be appropriate for v6.3,
since we > > are in beta testing and since they do not affect the
current functionality.  > > For those cases, how about submitting
patches based on the final v6.3 > > release?

There's more to come. Please review these patches. I ran the
regression tests and they only failed where this was expected
(random, geo, etc).

Cheers,

Jeroen
1998-03-30 16:47:35 +00:00
Bruce Momjian 4799bb8d33 Fix for pg_dump of large objects, from alvin@camberlo.demon.co.uk. 1998-03-16 05:41:39 +00:00
Bruce Momjian 3674ccdf95 Change Postgres95 to PostgreSQL. Update CLUSTER manual page. 1998-03-14 21:58:09 +00:00
Bruce Momjian ea89acc4d7 Rename pg_user to pg_shadow. 1998-03-06 17:25:51 +00:00
Bruce Momjian a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
Bruce Momjian 2ed7b03c46 Fix -t for pg_dump when table is uppercase. 1998-02-18 15:33:37 +00:00
Marc G. Fournier 2df6bba3ca From: PostgreSQL DataBase <postgres@scuba.pcpipeline.com>
This again fixes the problem
with the default permissions for PUBLIC and the preventing of
statements like "GRANT null on test to test_user;".
1998-01-30 15:03:35 +00:00
Marc G. Fournier 2780576e36 From: "Pedro J. Lobo" <pjlobo@euitt.upm.es>
I've patched pg_dump.c and createdb to add support for password
authentication, using the '-u' switch as in psql. I have updated also the
man pages.
1998-01-29 02:26:47 +00:00
Bruce Momjian c65ea0e040 New pg_attribute.atttypmod for type-specific information like
varchar length.

Cleans up code so attlen is always length.

Removed varchar() hack added earlier.

Will fix bug in selecting varchar() fields, and varchar() can be
variable length.
1998-01-16 23:21:07 +00:00
Marc G. Fournier 0aa928764a Various fixes NETBSD/sparc related
From: Tom I Helbekkmo <tih@Hamartun.Priv.NO>
1998-01-04 19:13:04 +00:00
Vadim B. Mikheev 031f471f44 Prototypes for new funcs. 1997-12-26 08:45:27 +00:00
Bruce Momjian a68a132a6c Add VARHDRSZ where needed. Many places just used 4. 1997-12-06 22:57:36 +00:00
Marc G. Fournier 84fc5c4aed I found one other change that I would like to make to the
src. It is in the function ParseACL. When I find that I
can not allocate enough memory for the ACL structure I
return an NULL instead of doing an exit_nicely(g_conn);

From: Matthew C Aycock <maycock@scuba.pcpipeline.com>
1997-12-05 01:04:25 +00:00
Marc G. Fournier 8a57e21c30 Incorporate patch from Matt(maycock@intelliquest.com) for dumping ACLs
Clean up formatting of code

Integrate new functions into dumpTable


This is not tested yet...have to recompile server due to patches from
Todd...but this compiles cleanly as it stands now
1997-12-04 01:31:28 +00:00
Bruce Momjian b05eddaaab Fix pg_dump, and libpq changes. 1997-12-01 22:02:49 +00:00
Bruce Momjian dfc1a6a848 Document pg_dump -z, clean up option list. Fix problem with libpq handling of field names uppercase code. 1997-12-01 21:01:24 +00:00
Bruce Momjian 043cebce2b More archive cleanup. 1997-11-21 19:02:59 +00:00
Bruce Momjian 3fa2bb316c Remove archive stuff. 1997-11-21 18:12:58 +00:00
Thomas G. Lockhart 0dd738148c Support SQL92 delimited identifiers by checking some attribute names
for mixed-case and surrounding with double quotes.
1997-10-30 16:48:03 +00:00
Bruce Momjian c35d7fb835 Rename pg_dump -H option to -h. 1997-10-30 03:59:59 +00:00
Bruce Momjian a805635d21 Cleanups for 6.2.1. 1997-10-16 04:14:30 +00:00
Vadim B. Mikheev abb0e707da Dump DEFAULT, CHECK, Triggers.
Fix BASETYPE for aggregates with sfunc2 only.
1997-10-02 13:57:07 +00:00
Bruce Momjian e00f0ea39e Fix for pg_dump. 1997-09-24 16:20:04 +00:00
Bruce Momjian 837f0cbea0 CREATE FUNCTION fixup for types of functions. 1997-09-24 15:36:36 +00:00
Bruce Momjian 77d514a550 Rollback changes to pg_dump.c 1997-09-24 15:14:02 +00:00
Bruce Momjian a572fc229b Fix for CREATE FUNCTION. 1997-09-23 21:44:07 +00:00
Bruce Momjian 59f6a57e59 Used modified version of indent that understands over 100 typedefs. 1997-09-08 21:56:23 +00:00
Bruce Momjian 075cede748 Add typdefs to pgindent run. 1997-09-08 20:59:27 +00:00
Bruce Momjian 319dbfa736 Another PGINDENT run that changes variable indenting and case label indenting. Also static variable indenting. 1997-09-08 02:41:22 +00:00
Bruce Momjian 1ccd423235 Massive commit to run PGINDENT on all *.c and *.h files. 1997-09-07 05:04:48 +00:00
Bruce Momjian 35378a4efc Fix syntax error. 1997-09-03 16:48:59 +00:00
Bruce Momjian e045278e7e Fix for no NULL in CREATE TABLE. 1997-08-22 17:15:41 +00:00
Bruce Momjian f1edf02cc1 Change pg_attribute.attnvals to float4, change #ifdef 0 to #if 0, fix aix call to strNcpy, fix pg_super_user_id in pg_dumpall, change pg_database.dtadba from oid to int4. 1997-08-21 02:28:55 +00:00
Bruce Momjian 63fbdd358f Portability fix for pg_dumpall. 1997-08-20 15:06:48 +00:00
Bruce Momjian 1d8bbfd2e7 Make functions static where possible, enclose unused functions in #ifdef NOT_USED. 1997-08-19 21:40:56 +00:00
Vadim B. Mikheev b992e200b8 NOT NULL implementation (submitted by Robson Paniago de Miranda). 1997-08-19 04:46:15 +00:00
Bruce Momjian fd6b3c26ef fix small memory free error. 1997-07-28 23:53:54 +00:00
Bruce Momjian 9ad6e0db30 More pg_dump patch cleanups. 1997-07-23 17:42:25 +00:00
Bruce Momjian a7d417cc2f Fix problems with pg_dump for iheritance, sequences, archive tables. 1997-07-23 17:15:13 +00:00
Bruce Momjian a89f9731e9 Have pg_dumpall return proper status on exit 1997-07-12 15:57:31 +00:00
Bruce Momjian 7e75f5e8b3 Small pg_dumpall cleanup. 1997-06-25 21:24:57 +00:00
Bruce Momjian a53d85404e pg_dump, pg_dumpall cleanups. 1997-06-21 16:08:17 +00:00
Bruce Momjian a75d6aaa41 Check pgdump return request. 1997-06-20 16:37:10 +00:00
Bruce Momjian dd2c410616 Allow pg_dump to preserve owners of all objects. 1997-06-20 02:20:26 +00:00
Bruce Momjian 5c34462d9c Make LO patter consistent with psql. 1997-06-07 05:29:22 +00:00
Bruce Momjian 51b03770d7 avoid xinv* table name conflict with large objects. 1997-06-07 05:19:06 +00:00
Bruce Momjian a668b7ac2d Fix for large objects and case sensitivity, from Raymond Toy. 1997-06-05 22:59:45 +00:00
Marc G. Fournier f9f98e3aff From: Igor <igor@sba.miami.edu>
Subject: [PATCHES] pg_dump memory leak patch

This patch fixes a HUGE memory leak problem in pg_dump.
Pretty much anything that was allocated was never freed and Purify
reported about 40% possible memory leak and 6% actual leak. I added
functions to clear out all the allocated structures. After the patch
Purify returns 0 for number of bytes leaked...
1997-06-02 02:52:06 +00:00
Bruce Momjian fce2c41b6c Updated pg_dumpall and psql to preserve database owners. 1997-05-21 03:12:23 +00:00
Bruce Momjian a1157deb57 Added fcvt() prot for bsdi.
Made PQsetdb() and PQfnumber() case-insensitive.
Removed attempt to set table ownership via pg_dumpall.
1997-05-20 03:39:02 +00:00
Bruce Momjian 2fc04874a6 Allow pg_dumpall to preserve database ownership. 1997-05-14 19:49:34 +00:00
Marc G. Fournier a5d7eb90a8 From: Keith Parks <emkxp01@mtcc.demon.co.uk>
Subject: [PATCHES] Three small patches.

Hi,

Here are 3 small patches to the postgreSQL source sup'd on
the 6th May 1997.

The 1st 2 fix the shell backslash "c" handling used to suppress
the newline on some unix shells. (The \c needs to be inside quote.)

The 3rd may or may not be the correct way to fix the missing
define of INDEX_MAX_KEYS in pg_dump.h
1997-05-07 02:59:59 +00:00
Vadim B. Mikheev a65dd5290e 1. Multi-column indices support.
2. Fix for function indices with more than 1 attrs.
1997-05-06 05:20:21 +00:00
Marc G. Fournier e52b943fdb Missed an -I directive 1997-04-26 06:13:31 +00:00
Marc G. Fournier c2ae467300 clean up the bin/*/Makefiles...up version.h to v6.1 instead of v6.0
Remove bin/Makefile.global since it wasn't actually *doing* anything
that Makefile.global hadn't already done
1997-04-26 05:07:12 +00:00
Marc G. Fournier 1e9b80a2fd modifications to pg_dump towards supporting dumping of ACLs (doesn't work yet!)
modification to c.h so that bool isn't typedef'd under __cplusplus
1997-04-12 09:24:23 +00:00
Marc G. Fournier c7b40e6058 This commit represents a clean compile with the new templates under
FreeBSD

The Makefile(s) have all been cleaned up such that there is a single
LDFLAGS vs LD_ADD or LDADD or LDFLAGS or LDFLAGS_BE.  The Makefile(s)
should be alot more straightforward then they were before...and
consistent
1997-04-04 10:43:16 +00:00
Vadim B. Mikheev b259e454e7 Dumping sequence relations as 'CREATE SEQUENCE ...'. 1997-04-02 04:17:27 +00:00
Bruce Momjian 7e6aeb5074 Substitute defines for numeric constants in type ids.
Use INT4OID instead of 23.
1997-03-01 15:24:51 +00:00
Bruce Momjian 326d1568fd Remove old READMEs. 1997-02-28 11:58:04 +00:00
Marc G. Fournier a5494a2d92 Various patches for nextstep by GregorHoffleit
Replaced NEED_STRDUP by !HAVE_STRDUP
1997-02-13 08:32:20 +00:00
Marc G. Fournier ad6bfe67bd Various fixes suggested by Gregor Hoffleit
Add a check to configure for strdup
Remove all the '-ltermcap' checks from psql/Makefile
Have {psql,pg_dump}/Makefile modified if strdup doesn't exist on the system
1997-02-09 03:23:52 +00:00
Marc G. Fournier fd84cafb69 |I took a look at this and I think pg_dump mishandles arrays of ints and floats
|by neglecting to quote them.
|
|I have made a minor change to pg_dump.c that will fix this.
|
|Dates are dumped and restored OK with pg_dump in V6
|
|We'll still need to fix the dump in both cases if the original dump is from V1.09.

From Keith Parks
1997-02-09 03:00:09 +00:00
Bruce Momjian e9e86aa59d Include main Makefile.global first so variables are not over-written. 1997-02-06 02:31:52 +00:00
Bruce Momjian 604f4a6928 Update handling of backslashes, and pg_user dump. 1997-01-19 10:15:59 +00:00
Bruce Momjian 3827f4e7f0 Remove blank lines. 1997-01-18 03:26:08 +00:00
Bruce Momjian aa91f930a4 Removed unneeded custom shell script call. 1997-01-17 23:48:50 +00:00
Bruce Momjian 3d97a61a60 Added pg_dumpall to source tree. 1997-01-16 15:28:34 +00:00
Marc G. Fournier 73b6ffbf76 Improvements to pg_dump to:
- dump Views

Submitted by: Keith Parks <emkxp01@mtcc.demon.co.uk>
1997-01-07 00:04:19 +00:00
Bryan Henderson 7ab0ceb824 Check that PQendcopy succeeded. Issue error message if not. 1996-12-30 23:05:16 +00:00
Bruce Momjian bbc0d47773 Fixed error where = should be ==. 1996-12-28 22:44:58 +00:00
Bryan Henderson 15526ff0ac Add messages to assist in problem diagnosis. Eliminate lines > 80 characters. 1996-12-27 23:12:57 +00:00
Bryan Henderson f0e7004d29 Make strdup work for Ultrix. Thanks Erik Bertelsen 1996-11-28 03:32:18 +00:00
Bryan Henderson 93f722536f Whoops, redo Ultrix patch so the other ports still compile. 1996-11-26 07:39:11 +00:00
Bryan Henderson 46d58fba33 Make it compile on Ultrix. Thanks Erik Bertelson. 1996-11-26 03:20:35 +00:00
Bruce Momjian 9d45f22e38 Here is the patch for pg_dump not handling NULL values in 'insert'
mode properly.  This will apply correctly to 1.09 & 2.0 sources.
From David H. Bennett
1996-11-20 22:32:55 +00:00
Bruce Momjian ca1a20eba4 Fix for -da option of pg_dump. 1996-11-17 04:56:16 +00:00
Bryan Henderson bbe89089c8 Add dependency for install. 1996-11-12 06:11:52 +00:00
Bryan Henderson 6f708e42d1 Makefile simplification: the "bin" chapter 1996-11-11 13:41:36 +00:00
Bryan Henderson 4e70c05979 Add #include <unistd.h> to quiet warning about missing getopt() declaration. 1996-11-10 01:35:39 +00:00
Bruce Momjian 4b2b8592a0 Compile and warning cleanup 1996-11-08 06:02:30 +00:00
Bruce Momjian 7e42f4814d Removed PORTNAME_. Use OS version only. 1996-11-04 04:00:56 +00:00
Bruce Momjian 3d7fe6c97c Added needed include file. 1996-10-31 05:58:01 +00:00
Marc G. Fournier ea733aa997 Fix a couple of small things from D'Arcy's last patch
Submitted by: D'Arcy Cain
1996-10-07 21:17:01 +00:00
Marc G. Fournier de466eb8f4 Mostly adding "const" keyword and making some functions static.
Submitted by: D'Arcy Cain
1996-10-07 03:30:40 +00:00
Marc G. Fournier 67e8736348 change stdout to fout
Submitted by: Carsten Heyl <heyl@nads.de>
1996-10-02 21:38:35 +00:00
Marc G. Fournier 87799e38f1 Prototype setMaxOid()
Submitted by: Bruce
1996-09-23 18:15:41 +00:00
Marc G. Fournier f589ca6800 The following diffs remove the various definitions of dupstr() and replace
all the calls with strdup.

Submitted by: darcy@druid.druid.com (D'Arcy J.M. Cain)
1996-09-16 06:06:17 +00:00
Marc G. Fournier c449668d3e Fix prototype for dumpClasses 1996-08-26 05:46:39 +00:00
Marc G. Fournier 208a30f23d The patch does several things:
It adds a WITH OIDS option to the copy command, which allows
dumping and loading of oids.

        If a copy command tried to load in an oid that is greater than
its current system max oid, the system max oid is incremented.  No
checking is done to see if other backends are running and have cached
oids.

        pg_dump as its first step when using the -o (oid) option, will
copy in a dummy row to set the system max oid value so as rows are
loaded in, they are certain to be lower than the system oid.

        pg_dump now creates indexes at the end to speed loading


Submitted by:  Bruce Momjian <maillist@candle.pha.pa.us>
1996-08-24 20:49:41 +00:00
Marc G. Fournier e7a110b418 This patch can be installed as part of 1.02.1 so people can properly
pg_dump and load to 2.0.  I haven't gotten any feedback on whether
people want it, so I am submitting it for others to decide.  I would
recommend an install in 1.02.1.

I had said that the 2.0 pg_dump could dump a 1.02.1 database, but I was
wrong.  The copy is actually performed by the backend, and the 2.0
database will not be able to read 1.02.1 databases because of the new
system columns.

This patch does several things.  It copies nulls out as \N, so they can
be distinguished from '' strings.  It fixes a problem where backslashes
in the input stream were not output as double-backslashes.  Without this
patch, backslashes copied out were deleted upon input, or interpreted as
special characters.  Third, input is now terminated by backslash-period.
This can not be part of a normal input stream.

I tested this by creating a database with all sorts of nulls, backslash,
and period fields and dumped the database and reloaded into a new
database and compared them.

Submitted by: Bruce
1996-08-14 05:33:11 +00:00
Marc G. Fournier cb34902cbd Move port includes from bin/pg_dump/Makefile to Makefile.global 1996-07-31 18:59:00 +00:00
Marc G. Fournier 7d2000e3a7 Fix for <machine.h> bug
Submitted by: Bruce
1996-07-31 17:35:13 +00:00
Marc G. Fournier c114bf330d A "lost in the archives" patch from Chris Dunlop <chris@atlas.onthe.net.au> 1996-07-31 06:09:46 +00:00
Marc G. Fournier 22113f81fd This is a patch to pg_dump which fixes varchar and char printing in the
case where the attribute length is variable (stored as -1).  Previously,
you'd get output that looked like:

CREATE TABLE foo (bar varchar(-1));

Monitor and psql don't like this at all :).  Here is a fix:


Submitted by: Adam Sussman <myddryn@vidya.com>
1996-07-27 02:29:51 +00:00
Marc G. Fournier 672f6ece23 Brought in David Bennett's (dave@bensoft.com) changes to pg_dump 1996-07-22 08:37:00 +00:00
Marc G. Fournier d602a35d37 Brought in extensions to pg_dump
Submitted by: david bennett <dave@bensoft.com>
	      marc g. fournier <scrappy@ki.net>
1996-07-12 05:39:39 +00:00
Marc G. Fournier d31084e9d1 Postgres95 1.01 Distribution - Virgin Sources 1996-07-09 06:22:35 +00:00