Commit Graph

12084 Commits

Author SHA1 Message Date
Peter Eisentraut 378f59904a Fix CFLAGS selection to actually work. Add test to detect whether gcc's
option -fno-strict-aliasing is available.
2003-10-25 15:32:11 +00:00
Bruce Momjian 6db0a6b035 Remove socket credentials defines not referenced. 2003-10-25 03:48:47 +00:00
Bruce Momjian e69b2f3b0e Remove weird test in ccsym 2003-10-24 21:28:52 +00:00
Bruce Momjian cded27cacd Don't reference pthread.h unless we have threads enabled, per Peter. 2003-10-24 20:48:10 +00:00
Peter Eisentraut 2034a87a53 Use AROPT, not hard-coded flags. 2003-10-24 20:31:43 +00:00
Peter Eisentraut b3be5e65e8 Translation updates 2003-10-24 12:07:56 +00:00
Tom Lane 0634c01e3a Add missing semicolon, per Johann Uhrmann.
Avoids warnings from newer bisons.
2003-10-22 16:43:42 +00:00
Tom Lane 6fbb14a174 Update the complex-datatype example to V1 function calling conventions,
and add binary send/receive functions.  Fix some other grottiness such
as failure to mark the C functions STRICT.
2003-10-21 22:51:14 +00:00
Tom Lane 2b23bf376b Fix built-in SQL-language functions to ensure that referenced names
are properly schema-qualified.

Christopher Kings-Lynne
2003-10-21 16:23:16 +00:00
Tom Lane 7eb67fc98b Cope with platforms that offer LONGLONG_MIN in place of the C99-spec
LLONG_MIN.  One example is AIX, per report from Andreas.
2003-10-21 15:34:34 +00:00
Tom Lane c9f8c2fd04 Revert to 7.3-and-before practice of only including <fcntl.h> in c.h
on Windows; per complaint from Andreas that it breaks AIX build.
2003-10-21 15:32:58 +00:00
Tom Lane 10add9d8ca Fix findLastBuiltinOid_V70() to deliver correct result when running
against a 7.0 server.

Christopher Kings-Lynne
2003-10-21 04:46:28 +00:00
Peter Eisentraut fd90da7f94 Update catalog version after information schema changes. 2003-10-20 21:39:37 +00:00
Tom Lane 3b64171edb Complain if pg_restore is given both -d and -f options; this suggests
the user is confused about whether -f is input or output file.
2003-10-20 21:05:12 +00:00
Tom Lane 1df7a455dd It is possible for ResolveNew to be used to insert a sublink into a
subquery that didn't previously have one.  We have traditionally made
the caller of ResolveNew responsible for updating the hasSubLinks flag
of the outermost query, but this fails to account for hasSubLinks in
subqueries.  Fix ResolveNew to handle this.  We might later want to
change the calling convention of ResolveNew so that it can fix the
outer query too, simplifying callers.  But I went with the localized
fix for now.  Per bug report from J Smith, 20-Oct-03.
2003-10-20 20:01:59 +00:00
Tom Lane 17841ddbbf Improve error reporting in parseTypeString(), motivated by confusing
behavior reported by Martin Marques.
2003-10-20 17:25:42 +00:00
Michael Meskes 3b72087bf6 Install dummy sqlda.h file since this is needed for compatibility. 2003-10-20 12:54:29 +00:00
Tom Lane 41e6e36719 When building shared libraries on HPUX with gcc, forcibly include -lgcc
to ensure any needed compiler support routines are included.  This is
arguably appropriate on *every* gcc platform, but for the moment I'll take
the conservative approach of only doing it on a platform where it's
provably useful.  Per complaint from Heiko Lehmann, 13-Feb-03, as well
as personal experience --- contrib/pgstattuple has never worked for me,
but it does now.
2003-10-20 01:34:33 +00:00
Tom Lane 6f169057de Save_r, Save_t should be static not global variables. 2003-10-19 23:43:51 +00:00
Tom Lane 9dfdbef345 Adjust libpq to avoid deadlock when both client and server want to send
data, and both have filled the transmission buffers.  One scenario where
this can happen was illustrated here:
http://archives.postgresql.org/pgsql-hackers/2003-04/msg00979.php
2003-10-19 21:36:41 +00:00
Michael Meskes d5353acbc3 Check for both Informix modes when parsing include files. 2003-10-19 13:22:33 +00:00
Peter Eisentraut 9d77708d83 Cleanup on --help-config: Now called --describe-config, no further options,
machine readable, without headers, not sorted.  Parameter descriptions
adjusted to fit first sentence + rest convention.
2003-10-18 22:59:09 +00:00
Tom Lane e341cdb085 Further work on information_schema. _pg_keyissubset() wasn't quite
fully search-path-proof yet; also, element_types view did not work for
parameters and result types of functions, because it didn't generate
the object_name for the function the same way the data_type_privileges
view does.  While at it, centralize dependencies on INDEX_MAX_KEYS/
FUNC_MAX_ARGS into a function returning setof int, so that it will be
easier to fix information_schema for nonstandard values of these
parameters.
2003-10-18 19:06:10 +00:00
Tom Lane eda80f09ff Repair interaction between IN-join processing and subselect pullup that
I inadvertently broke a few days ago (per report from Sean Thomas).
Add regression test case to try to catch any similar breakage in future.
2003-10-18 16:52:15 +00:00
Tom Lane c02036b1d8 Simplify loop test to avoid bug in AIX compiler, per Andreas. 2003-10-18 15:38:06 +00:00
Peter Eisentraut 9ea6d0fc80 Information schema fixes:
Use pg_get_constraintdef instead of pg_constraint.consrc
Use UNION ALL instread of UNION
Make use of regclass type for getting OID of system catalogs
Add schema qualifications where necessary
Fix typos
2003-10-18 12:53:35 +00:00
Tom Lane f2f7107024 Must free the pgParameterStatus chain in freePGconn(). My fault,
well spotted by Neil Conway.
2003-10-18 05:02:06 +00:00
Tom Lane bbba5080b5 Fix elog tab-insertion code to insert tabs only where wanted. 2003-10-17 16:49:03 +00:00
Peter Eisentraut 1b7ac7f130 Remove automatic '()' in other branch of UNION as well. 2003-10-17 11:52:06 +00:00
Tom Lane fe1b5034dd Adjust display of actual runtimes in EXPLAIN output to use three fractional
digits, and label it 'ms' not 'msec', for consistency with psql's \timing
display.  Per recent discussions.
2003-10-17 01:14:26 +00:00
Tom Lane fa2356a1ac Use pg_get_constraintdef() rather than pg_constraint.consrc; this is
a portion of a patch recently submitted by Christopher Kings-Lynne.
Applied by agreement that this is a bug fix.
2003-10-17 00:57:04 +00:00
Peter Eisentraut 44430dbc15 Fix bugs in referential_constraints view. 2003-10-16 23:46:17 +00:00
Peter Eisentraut 4a48c671d2 There should not be an automatic '()' after a function name when
tab-completing.
2003-10-16 23:45:29 +00:00
Tom Lane 52b59a7bec Set attstattarget to -1 for all system catalog columns. All but a few
of the entries used to be zero, which I think I had deliberately done in
the name of saving cycles during ANALYZE, but it was really a rather
foolish decision.  Some of the more complex views in information_schema
were getting really bad plans for lack of statistics on the columns they
were joining over.

I'm not forcing an initdb for this, but I think there will be one soon
anyway to repair some bugs in the information_schema views.
2003-10-16 22:52:22 +00:00
Tom Lane 64c1fc7257 Avoid division by zero in estimate_num_groups() when table has no rows. 2003-10-16 21:37:54 +00:00
Tom Lane 624292aa35 Ensure that all places that are complaining about exhaustion of shared
memory say 'out of shared memory'; some were doing that and some just
said 'out of memory'.  Also add a HINT about increasing max_locks_per_transaction
where relevant, per suggestion from Sean Chittenden.  (The former change
does not break the strings freeze; the latter does, but I think it's
worth doing anyway.)
2003-10-16 20:59:35 +00:00
Tom Lane 2ec74435cd Cause tab completion to do something moderately reasonable with mixed-case
identifiers --- it will now complete these correctly with double quoting.
Fix a few other issues in passing.
2003-10-16 20:03:09 +00:00
Tom Lane 90b2202975 Fix bad interaction between NOTIFY processing and V3 extended query
protocol, per report from Igor Shevchenko.  NOTIFY thought it could
do its thing if transaction blockState is TBLOCK_DEFAULT, but in
reality it had better check the low-level transaction state is
TRANS_DEFAULT as well.  Formerly it was not possible to wait for the
client in a state where the first is true and the second is not ...
but now we can have such a state.  Minor cleanup in StartTransaction()
as well.
2003-10-16 16:50:41 +00:00
Peter Eisentraut 3992f1c50b Translation updates 2003-10-15 10:00:20 +00:00
Peter Eisentraut e9b2b56c23 New translation 2003-10-15 09:49:07 +00:00
Peter Eisentraut 578774d5f5 Translation update 2003-10-15 09:45:34 +00:00
Peter Eisentraut dee5b779fa New translation 2003-10-15 09:39:04 +00:00
Tom Lane 77c1791a58 Use PQescapeString to ensure that tab-completion queries are not messed
up by quotes or backslashes in words that are being matched to database
names (per gripe from Ian Barwick, though I didn't use his patch).
Also fix possible memory leakage if _complete_with_query isn't run to
completion (not clear if that can happen or not, but be safe).
2003-10-14 22:47:12 +00:00
Bruce Momjian 2a0f1c08d5 Remove void* in MemSet until we understand the gcc 3.3.1 problem better. 2003-10-14 19:08:00 +00:00
Tom Lane d18ba3f452 pull_up_subqueries() should copy the subquery before starting to modify
it.  Not sure why I'd thought it would be a good idea to do differently
way back when, but Greg Stark exposed the folly of doing so ...
2003-10-13 23:48:16 +00:00
Bruce Momjian 4a39057e59 Back out makeNode() patch to fix gcc 3.3.1 warning. 2003-10-13 22:47:15 +00:00
Peter Eisentraut 27318d8873 Translation update 2003-10-13 21:38:37 +00:00
Tom Lane 87299583a5 Determine max_connections first, then see how large shared_buffers can
be made, to avoid corner cases where max_connections ends up unreasonably
small because shared_buffers is hogging too much shmem space.  Per pghackers
discussion about a week ago.  Also, fix the copy-newlines problem in a
more robust way, by using COPY FROM filename instead of COPY FROM STDIN;
per a suggestion from Peter.
2003-10-13 21:06:44 +00:00
Tom Lane e7261c46aa Adjust setRelhassubclassInRelation() to not perform actual heap_update
when the pg_class.relhassubclass value is already correct.  This should
avoid most cases of the 'tuple concurrently updated' problem that
Robert Creager recently complained about.  Also remove a bunch of dead
code in StoreCatalogInheritance() --- it was still computing the complete
list of direct and indirect inheritance ancestors, though that list has
not been needed since we got rid of the pg_ipl catalog.
2003-10-13 20:02:52 +00:00
Bruce Momjian 4a2c34d4a0 Use makeNode() to allocate structures that have to be cast to Node *,
rather than allocating them on the stack.

Fixes complaint from gcc 3.3.1.
2003-10-12 23:19:21 +00:00
Peter Eisentraut 037468eff2 New translation 2003-10-12 19:16:36 +00:00
Michael Meskes 84b35a7f76 Added missing "commit" in test case. 2003-10-12 15:19:46 +00:00
Bruce Momjian f22ddf70be Add void * cast to MemSet to silence compiler, and add comment that we
already check for alignment.
2003-10-11 19:53:45 +00:00
Bruce Momjian 7fb9893f42 Back out -fstrict-aliasing void* casting. 2003-10-11 18:04:26 +00:00
Peter Eisentraut 47ed43440e Translation updates 2003-10-11 17:11:02 +00:00
Bruce Momjian d51368dbbd This patch will stop gcc from issuing warnings about type-punned objects
when -fstrict-aliasing is turned on, as it is in the latest gcc when you
use -O2

Andrew Dunstan
2003-10-11 16:30:55 +00:00
Peter Eisentraut 108f371769 Translation updates 2003-10-10 08:01:44 +00:00
Bruce Momjian 9821455425 Rename __arm__/__arm__ to __arm__/__arm, found by Neil Conway 2003-10-10 03:58:57 +00:00
Bruce Momjian 962987a1c2 Add NULL regression tests.
Manfred Koizar
2003-10-10 03:46:51 +00:00
Bruce Momjian d7c971ab7d Change Win32 rename/unlink timeout to 3 seconds. 2003-10-10 03:27:58 +00:00
Bruce Momjian 99a53d89c8 Allow pg_id to compile on Win32.
Andrew Dunstan
2003-10-10 01:34:51 +00:00
Bruce Momjian c568b8fbe7 Remove -pipe from compiles. 2003-10-09 22:55:46 +00:00
Peter Eisentraut 172b125578 Make sure that -- comments extend to the end of the line. This fixes the
misscanning of this construct:

SELECT ''hello world''
-- SELECT ''goodbye world''
::text;
2003-10-09 19:13:23 +00:00
Peter Eisentraut 034b065a66 Some updates 2003-10-09 19:11:03 +00:00
Bruce Momjian dfafeb6a89 Update Solaris FAQ to mention -fast. 2003-10-09 17:11:13 +00:00
Bruce Momjian b1d955ea7b Remove -pipe on Linux, per reports from Peter. 2003-10-09 16:52:45 +00:00
Bruce Momjian 85bd172c45 Add -pipe compile for Linux. 2003-10-09 14:47:59 +00:00
Bruce Momjian 7185455c08 Make template CFLAGS handling consistent. 2003-10-09 14:40:37 +00:00
Bruce Momjian 6687152582 Re-add -pipe compile flags for bsd's. 2003-10-09 04:34:02 +00:00
Bruce Momjian 0e22cb1232 This centralizes the optimization defaults into configure.in, rather
than having CFLAGS= in the template files.

It uses -O2 for gcc (generated by autoconf), and -O for non-gcc, unless
the template overrides it.
2003-10-09 03:20:34 +00:00
Bruce Momjian dcad7949f8 Change "query:" to "statement:".
Have log_duration print when log_min_duration_statement prints.
2003-10-09 02:40:18 +00:00
Bruce Momjian 6acca5765e Add quotes to CFLAG define. 2003-10-09 02:37:09 +00:00
Jan Wieck f8d90fcc0a Protected access to variable m_preparedCount via synchronized
function to prevent multiple threads using automatic cursors on
the same connection from stomping over each others cursor.

Jan
2003-10-09 01:17:07 +00:00
Peter Eisentraut 46c27c6997 New translations 2003-10-08 20:35:39 +00:00
Peter Eisentraut c99a41be95 New translations 2003-10-08 18:38:49 +00:00
Bruce Momjian 2ff4091862 Add quotes around -O setting for consistency. 2003-10-08 18:23:08 +00:00
Michael Meskes 163f0b2d48 Removed my debug printf() call from numeric.c 2003-10-08 08:28:57 +00:00
Bruce Momjian bdae05f5d1 Use calloc() to allocate empty structures.
Fix pg_restore tar log output bug where Special flag wasn't being
initialized; bug seen on XP.
2003-10-08 03:52:32 +00:00
Bruce Momjian b8382c2688 Have log_min_duration_statement = 0 always print duration/statement.
Change log line to be "duration:  ms  query:"

Indent multi-line queries with a tab in the server logs.
2003-10-08 03:49:38 +00:00
Michael Meskes cfd992ecba Fixed floating point exception in long=>numeric conversion. 2003-10-07 18:36:46 +00:00
Bruce Momjian d665217278 Fix include used by entab. 2003-10-07 17:40:09 +00:00
Peter Eisentraut 06e6aa236c Add missing include file. 2003-10-07 08:07:56 +00:00
Michael Meskes 3cda980298 Fixed error handling in Informix compat str to date conversion. 2003-10-07 05:46:56 +00:00
Peter Eisentraut 34e9ab027b New Italian translation 2003-10-06 21:50:45 +00:00
Tom Lane b05ff39d7c Fix binary_oper_exact() so that the heuristic 'an unknown literal on
one side of a binary operator is probably supposed to be the same type
as the other operand' will be applied for domain types.  This worked
in 7.3 but was broken in 7.4 due to code rearrangements.  Mea culpa.
2003-10-06 20:09:47 +00:00
Peter Eisentraut f98cbb76a0 Translation updates 2003-10-06 17:37:39 +00:00
Tom Lane fec58f6c3f During ALTER TABLE ADD FOREIGN KEY, try to check the existing rows using
a single LEFT JOIN query instead of firing the check trigger for each
row individually.  Stephan Szabo, with some kibitzing from Tom Lane and
Jan Wieck.
2003-10-06 16:38:28 +00:00
Peter Eisentraut a0ab31dcc6 New Slovene translations 2003-10-06 16:31:16 +00:00
Michael Meskes aeb1f6478e - Fixed constant listing in execute using clause.
- Fixed typo in ecpg for Informix dec_t type.
- Fixed precision handling in Informix compat funxtions.
2003-10-06 06:44:55 +00:00
Peter Eisentraut 5e3aaf5402 Translation updates 2003-10-06 06:20:11 +00:00
Tom Lane 0eceaaf9b7 Modify COPY FROM to match the null-value string against the column value
before it is de-backslashed, not after.  This allows the null string \N
to be reliably distinguished from the data value \N (which must be
represented as \\N).  Per bug report from Manfred Koizar ... but it's
amazing this hasn't been reported before ...
Also, be consistent about encoding conversion for null string: the form
specified in the command is in the server encoding, but what is sent
to/from client must be in client encoding.  This never worked quite
right before either.
2003-10-06 02:38:53 +00:00
Tom Lane 351adb8dfb Fix order of operations within SendQuery() so that the time spent in
data transfer during COPY is included in the \timing display.  Also
avoid portability problems if tv_usec is unsigned on some platform.
2003-10-06 01:11:12 +00:00
Tom Lane a1dcd8f6dd Add a little more smarts to estimate_hash_bucketsize(): if there's no
statistics, but there is a unique index on the column, we can safely
assume it's well-distributed.
2003-10-05 22:44:25 +00:00
Bruce Momjian 22347dc102 Make psql \timing show three digits. 2003-10-05 22:36:00 +00:00
Peter Eisentraut eceff4cc55 Translation updates 2003-10-05 21:52:37 +00:00
Peter Eisentraut 83a234926c When revoking privileges from the owner, don't revoke the grant options,
to avoid recursively revoking everything from everyone.
2003-10-05 21:49:12 +00:00
Michael Meskes 8e6b74e4fd Fixed bug in day of week processing. 2003-10-05 11:12:00 +00:00
Peter Eisentraut f261af3f74 Translation update 2003-10-04 22:50:20 +00:00
Tom Lane fa09ee6026 Document the always-true-but-previously-undocumented fact that PQfnumber()
will downcase the supplied field name unless it is double-quoted.  Also,
upgrade the routine's handling of double quotes to match the backend,
in particular support doubled double quotes within quoted identifiers.
Per pgsql-interfaces discussion a couple weeks ago.
2003-10-04 21:05:21 +00:00
Tom Lane b833c3d4a4 Fix pg_get_constraintdef() to ensure CHECK constraints are always shown
with required outer parentheses.  Breakage seems to be leftover from
domain-constraint patches.  This could be smarter about suppressing
extra parens, but at this stage of the release cycle I want certainty
not cuteness.
2003-10-04 18:22:59 +00:00
Peter Eisentraut 0a14ffe5b5 Translation updates 2003-10-04 18:13:16 +00:00
Peter Eisentraut 8bc9fcb51f Translation update 2003-10-04 18:09:08 +00:00
Bruce Momjian 1c4d4cb17d Fix log_duration and log_min_duration_statement to print properly, as
pointed out by Peter.
2003-10-04 02:47:04 +00:00
Peter Eisentraut 75e76e1cf5 Translation updates 2003-10-04 01:07:05 +00:00
Peter Eisentraut 4cb67993a7 Format help message internally consistent. 2003-10-04 01:06:38 +00:00
Peter Eisentraut 9951474c71 Change transaction status indicator in prompt from %T to %x. 2003-10-04 01:04:46 +00:00
Peter Eisentraut beb935148a New translation 2003-10-03 22:39:34 +00:00
Tom Lane ef88199f61 Issue 'SET check_function_bodies = false' to suppress possible restore
failures in SQL functions, due to forward references or unqualified
references to objects in other schemas.  Per recent discussion.
2003-10-03 20:10:59 +00:00
Tom Lane 15c194c1d5 Add GUC parameter check_function_bodies to control whether validation
of function bodies is done at CREATE FUNCTION time.  This is normally
true but can be set false to avoid problems with forward references,
wrong schema search path, etc.  This is just the backend patch, still
need to adjust pg_dump to make use of it.
2003-10-03 19:26:49 +00:00
Tom Lane 251033186f Cause PQescapeString to stop processing at a null character, rather
than generating an invalid output string.  Per observation and patch
from Igor Shevchenko.  Further code cleanup and documentation by
Tom Lane.
2003-10-03 18:26:14 +00:00
Tom Lane 3b4c142030 Remove assorted compilation failures introduced by latest ecpg changes.
Also remove -g, which has no business in CPPFLAGS in the first place,
let alone being hardwired there by a sub-Makefile.
2003-10-03 17:04:48 +00:00
Michael Meskes 1bd5e054ed Hide Informix datatypes. They are not seen by our built process anymore. 2003-10-03 10:07:28 +00:00
Tom Lane 19c90bcc25 Add a bit more locking to vac_update_relstats and vac_update_dbstats
to make them comparable to what UpdateStats does in the same situation.
I'm not certain two instances of vac_update_relstats could run in
parallel for the same relation, but parallel invocations of vac_update_dbstats
do seem possible.
2003-10-02 23:19:44 +00:00
Tom Lane bea8af9152 When dumping CREATE INDEX, must show opclass name if the opclass isn't
in the schema search path.  Otherwise pg_dump doesn't correctly dump
scenarios where a custom opclass is created in 'public' and then used
by indexes in other schemas.
2003-10-02 22:24:54 +00:00
Tom Lane b4966453f6 Do not return from PQrequestCancel until postmaster has finished
processing the request; this ensures that the request won't be taken
to cancel a subsequently-issued query.  Race condition originally
noted by Oliver Jowett in the context of JDBC, but libpq has it too.
2003-10-02 19:52:44 +00:00
Tom Lane bf2f5d9463 Don't use 0 as a spelling of NULL. 2003-10-02 14:47:44 +00:00
Peter Eisentraut d938e8b0f4 Add documentation about \pset footer to \?.
from Patrick Welche
2003-10-02 06:39:31 +00:00
Peter Eisentraut 14528ffe6b String fixes/improvements found by Alvaro Herrera 2003-10-02 06:36:37 +00:00
Peter Eisentraut e78b0079a2 Change some notices to warnings and vice versa according to criteria
developed on -hackers.
2003-10-02 06:34:04 +00:00
Peter Eisentraut 5b806ecf55 Remove NOTICE about foreign key creating implicit triggers, because it no
longer conveys useful information.
2003-10-02 06:32:46 +00:00
Tom Lane 04b40923d6 Add code to check that IF/WHILE/EXIT test expressions are boolean,
and try to coerce the values to boolean if not.  Per recent discussions.
2003-10-01 21:47:42 +00:00
Tom Lane 55d85f42a8 Repair RI trigger visibility problems (this time for sure ;-)) per recent
discussion on pgsql-hackers: in READ COMMITTED mode we just have to force
a QuerySnapshot update in the trigger, but in SERIALIZABLE mode we have
to run the scan under a current snapshot and then complain if any rows
would be updated/deleted that are not visible in the transaction snapshot.
2003-10-01 21:30:53 +00:00
Tom Lane 47ed658c59 heap_open => relation_open to avoid unwanted restriction on relkind.
Per gripe from Gaetano Mendola.
2003-09-30 00:59:51 +00:00
Tom Lane e33f205a94 Adjust btree index build procedure so that the btree metapage looks
invalid (has the wrong magic number) until the build is entirely
complete.  This turns out to cost no additional writes in the normal
case, since we were rewriting the metapage at the end of the process
anyway.  In normal scenarios there's no real gain in security, because
a failed index build would roll back the transaction leaving an unused
index file, but for rebuilding shared system indexes this seems to add
some useful protection.
2003-09-29 23:40:26 +00:00
Tom Lane 0e319c7ad7 Improve context display for failures during COPY IN, as recently
discussed on pghackers.
2003-09-29 22:06:40 +00:00
Jan Wieck 36f15ddecd Fixed type lookup in spi_prepare for possible qualified
type name specification.

Jan
2003-09-29 19:24:06 +00:00
Bruce Momjian 2f98ece4de The brackets aren't put on the CHECK constraints properly.
Before patch:

test=# select pg_get_constraintdef(oid) from pg_constraint;
                                       pg_get_constraintdef
-------------------------------------------------------------------------------------------------
  CHECK (VALUE >= 0)
  CHECK ((((a)::text = 'asdf'::text) OR ((a)::text = 'fdsa'::text)) OR
((a)::text = 'dfd'::text))
  PRIMARY KEY (b)
  FOREIGN KEY (a) REFERENCES test2(b)
  UNIQUE (b)
(5 rows)

test=# select pg_get_constraintdef(oid, true) from pg_constraint;
                                pg_get_constraintdef
-----------------------------------------------------------------------------------
  CHECK VALUE >= 0
  CHECK a::text = 'asdf'::text OR a::text = 'fdsa'::text OR a::text =
'dfd'::text
  PRIMARY KEY (b)
  FOREIGN KEY (a) REFERENCES test2(b)
  UNIQUE (b)
(5 rows)

After patch:

test=# select pg_get_constraintdef(oid) from pg_constraint;
                                       pg_get_constraintdef
-------------------------------------------------------------------------------------------------
  CHECK (VALUE >= 0)
  CHECK ((((a)::text = 'asdf'::text) OR ((a)::text = 'fdsa'::text)) OR
((a)::text = 'dfd'::text))
  PRIMARY KEY (b)
  FOREIGN KEY (a) REFERENCES test2(b)
  UNIQUE (b)
(5 rows)

test=# select pg_get_constraintdef(oid, true) from pg_constraint;
                                pg_get_constraintdef
-----------------------------------------------------------------------------------
  CHECK (VALUE >= 0)

`  CHECK (a::text = 'asdf'::text OR a::text = 'fdsa'::text OR a::text =
'dfd'::text)
  PRIMARY KEY (b)
  FOREIGN KEY (a) REFERENCES test2(b)
  UNIQUE (b)
(5 rows)

It's important that those brackets are there to (a) match all other
constraints and (b) so that people can just copy and paste them and it
will work as SQL.


Christopher Kings-Lynne
2003-09-29 18:55:56 +00:00
Bruce Momjian 4b4c43b146 This patch fixes an obvious bug in the "should I print the duration of
this query?" logic in postgres.c

Also, make it print "duration:" like log_duration.

Neil Conway
2003-09-29 18:50:58 +00:00
Bruce Momjian fc7a2affab I discovered that TupleDescGetAttInMetadata and BuildTupleFromCStrings
don't deal well with tuples having dropped columns. The attached fixes
the issue. Please apply.

Joe Conway
2003-09-29 18:22:48 +00:00
Bruce Momjian f3db606592 > >
> >  a) Write documentation how the win32 console needs to be set up so that
> >     psql can handle 8-bit characters.
> >     Where should it be added? The Section "Installation on Windows" in the
> >     Administrator's Guide seems natural to me.
> >
> >  b) Add code to psql that prints a warning on startup of psql when the
> >     console codepage differs from the windows codepage, something like
> >
> >     Warning: Console codepage (850) differs from windows codepage (1252)
> >              8-bit characters will not work correctly. See PostgreSQL
> >              documentation "Installation on Windows" for details.
>
Attached are two patches:

 - installdoc.patch contains an additional paragraph on the win32 console
   codepage for the chapter "Installation on Windows"
   Due to a lack of SGML-tools, I have only edited the text and not tested
   the SGML code - please check it before merging into the CVS branch.

 - psqlcodepage.patch adds the warning about a problematic codepage to psql.


Christoph Dalitz
2003-09-29 18:21:33 +00:00
Peter Eisentraut 55fbc98b3f Adjust the new Norwegian translation for some of the easier message
changes between 7.3 and 7.4, for example quoting and function names.
2003-09-29 16:41:33 +00:00
Peter Eisentraut 275c909a8c Apparently, gettext doesn't like double parentheses around argument. What
were they doing here anyway?
2003-09-29 16:39:18 +00:00
Peter Eisentraut f4d5d620f2 Make message fit guidelines. 2003-09-29 16:38:04 +00:00
Peter Eisentraut 2d480b92cf Eliminate another gratuitous message wording difference. 2003-09-29 16:37:29 +00:00
Peter Eisentraut a776bd9b69 New Norwegian translation by Trond Endrestøl, actually made for 7.3, but
this should help people get started in 7.4 as well.
2003-09-29 10:57:06 +00:00
Peter Eisentraut b994b143a6 New translations 2003-09-29 09:51:29 +00:00
Bruce Momjian f7fca96366 Fix #error message to mention renamed option --disable-spinlocks. 2003-09-29 04:20:22 +00:00
Bruce Momjian 3e4b208285 Update docs that point to thread test program. 2003-09-29 03:32:05 +00:00
Tom Lane 5594aa6a6e Fix broken definition of :print: character class, per Bruno Wolff.
Also, make :alnum: character class directly dependent on isalnum()
rather than guessing.
2003-09-29 00:21:58 +00:00
Peter Eisentraut 3b97d9f525 Translation update 2003-09-29 00:17:42 +00:00
Peter Eisentraut 7438af96fa More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
Tom Lane 8b510838f6 Restructure plpgsql's caching of 'simple' expression evaluation trees
to be less dangerous, and often faster as well.  ExprState trees are
not kept across transaction boundaries; this eliminates problems with
resource leakage in failed transactions.  But by keeping them in a
per-transaction EState, we can safely arrange for a single ExprState
to be shared by all the expression evaluations done in a given plpgsql
function call.  (Formerly it seemed necessary to create and destroy an
ExprState for each exec_eval_simple_expr() call.)  This saves time in
any scenario where a plpgsql function executes more than one expression.
Seems to be about as fast as 7.3 for simple cases, and significantly
faster for functions that do a lot of calculations.
2003-09-28 23:37:45 +00:00
Tom Lane 8934790052 Add a mechanism to let dynamically loaded modules register post-commit/
post-abort cleanup hooks.  I'm surprised that we have not needed this
already, but I need it now to fix a plpgsql problem, and the usefulness
for other dynamically loaded modules seems obvious.
2003-09-28 23:26:20 +00:00
Tom Lane a15207f8d6 Now that we have UPDATE tab SET col = DEFAULT, get rid of horrid hack
in the RI triggers for ON DELETE/UPDATE SET DEFAULT.  The code depended
way too much on knowledge of plan structure, and yet still would fail
if the generated query got rewritten by rules.
2003-09-28 02:11:23 +00:00
Bruce Momjian a994d5984f Adjust pgindent for newer awks.
Nigel J. Andrews
2003-09-28 00:25:22 +00:00
Bruce Momjian b4ca39b956 Allow pgindent to work with newer BSD indents. 2003-09-28 00:22:58 +00:00
Bruce Momjian 74c8703031 Mark Linux for threads. 2003-09-27 22:23:35 +00:00
Tom Lane 0ac697b269 Remove erroneous restriction that -t cannot be used to select a
sequence for dumping.
2003-09-27 22:10:01 +00:00
Bruce Momjian 16e4adc38f Update bsd indent patch. 2003-09-27 21:26:09 +00:00
Bruce Momjian ee84100cc1 Cleanup pgindent patch. 2003-09-27 21:19:47 +00:00