summaryrefslogtreecommitdiff
path: root/src/backend/commands/variable.c
AgeCommit message (Collapse)Author
2005-08-08Fix crash when reading 'timezone = unknown' from postgresql.conf duringTom Lane
SIGHUP; it's not OK for an assign_hook to return a non-malloc'd string. Problem was introduced during timezone library rewrite.
2005-07-25Add SET ROLE. This is a partial commit of Stephen Frost's recent patch;Tom Lane
I'm still working on the has_role function and information_schema changes.
2005-07-21Add time/date macros for code clarity:Bruce Momjian
#define DAYS_PER_YEAR 365.25 #define MONTHS_PER_YEAR 12 #define DAYS_PER_MONTH 30 #define HOURS_PER_DAY 24
2005-07-20Add 'day' field to INTERVAL so 1 day interval can be distinguished fromBruce Momjian
24 hours. This is very helpful for daylight savings time: select '2005-05-03 00:00:00 EST'::timestamp with time zone + '24 hours'; ?column? ---------------------- 2005-05-04 01:00:00-04 select '2005-05-03 00:00:00 EST'::timestamp with time zone + '1 day'; ?column? ---------------------- 2005-05-04 01:00:00-04 Michael Glaesemann
2005-06-28Replace pg_shadow and pg_group by new role-capable catalogs pg_authidTom Lane
and pg_auth_members. There are still many loose ends to finish in this patch (no documentation, no regression tests, no pg_dump support for instance). But I'm going to commit it now anyway so that Alvaro can make some progress on shared dependencies. The catalog changes should be pretty much done.
2005-06-09Fix assign_datestyle() so that it doesn't misleadingly complain aboutTom Lane
'conflicting datestyle specifications' for input that's actually only redundant, such as SET DATESTYLE = MDY, MDY. Per recent gripe.
2005-06-05Code for SET/SHOW TIME ZONE with a fixed-interval timezone was notTom Lane
prepared for HAVE_INT64_TIMESTAMP. Per report from Guillaume Beaudoin.
2005-04-19Attached patch gets rid of the global timezone in the following steps:Bruce Momjian
* Changes the APIs to the timezone functions to take a pg_tz pointer as an argument, representing the timezone to use for the selected operation. * Adds a global_timezone variable that represents the current timezone in the backend as set by SET TIMEZONE (or guc, or env, etc). * Implements a hash-table cache of loaded tables, so we don't have to read and parse the TZ file everytime we change a timezone. While not necesasry now (we don't change timezones very often), I beleive this will be necessary (or at least good) when "multiple timezones in the same query" is eventually implemented. And code-wise, this was the time to do it. There are no user-visible changes at this time. Implementing the "multiple zones in one query" is a later step... This also gets rid of some of the cruft needed to "back out a timezone change", since we previously couldn't check a timezone unless it was activated first. Passes regression tests on win32, linux (slackware 10) and solaris x86. Magnus Hagander
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
2004-09-24GUC assign hooks that look at external state in deciding whether aTom Lane
setting is valid must ignore that state and permit the assignment anyway when source is PGC_S_OVERRIDE. Otherwise they may disallow a rollback at transaction abort, which is The Wrong Thing. Per example from Michael Fuhr 12-Sep-04.
2004-08-31Code review for various recent GUC hacking. Don't elog(ERROR) whenTom Lane
not supposed to (fixes problem with postmaster aborting due to mistaken postgresql.conf change); don't call superuser() when not inside a transaction (fixes coredump when, eg, try to set log_statement from PGOPTIONS); some message style guidelines enforcement.
2004-08-30Another pgindent run with lib typedefs added.Bruce Momjian
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-29Update copyright to 2004.Bruce Momjian
2004-08-11Avoid crashing when restoring a saved GUC session_authorization valueTom Lane
that refers to a now-deleted userid. Per gripe from Chris Ochs.
2004-07-01Nested transactions. There is still much left to do, especially on theTom Lane
performance front, but with feature freeze upon us I think it's time to drive a stake in the ground and say that this will be in 7.5. Alvaro Herrera, with some help from Tom Lane.
2004-05-26Reimplement the linked list data structure used throughout the backend.Neil Conway
In the past, we used a 'Lispy' linked list implementation: a "list" was merely a pointer to the head node of the list. The problem with that design is that it makes lappend() and length() linear time. This patch fixes that problem (and others) by maintaining a count of the list length and a pointer to the tail node along with each head node pointer. A "list" is now a pointer to a structure containing some meta-data about the list; the head and tail pointers in that structure refer to ListCell structures that maintain the actual linked list of nodes. The function names of the list API have also been changed to, I hope, be more logically consistent. By default, the old function names are still available; they will be disabled-by-default once the rest of the tree has been updated to use the new API names.
2004-05-23Avoid calling select_default_timezone() when backing out an unwanted TZTom Lane
setting. This is a temporary kluge to keep Alvaro happy; eventually we should fix the TZ library API to make the problem really go away.
2004-05-21Integrate src/timezone library for all platforms. There is more we canTom Lane
and should do now that we control our own destiny for timezone handling, but this commit gets the bulk of the picayune diffs in place. Magnus Hagander and Tom Lane.
2004-05-07Solve the 'Turkish problem' with undesirable locale behavior for caseTom Lane
conversion of basic ASCII letters. Remove all uses of strcasecmp and strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp; remove most but not all direct uses of toupper and tolower in favor of pg_toupper and pg_tolower. These functions use the same notions of case folding already developed for identifier case conversion. I left the straight locale-based folding in place for situations where we are just manipulating user data and not trying to match it to built-in strings --- for example, the SQL upper() function is still locale dependent. Perhaps this will prove not to be what's wanted, but at the moment we can initdb and pass regression tests in Turkish locale.
2004-01-19Repair problem identified by Olivier Prenant: ALTER DATABASE SET search_pathTom Lane
should not be too eager to reject paths involving unknown schemas, since it can't really tell whether the schemas exist in the target database. (Also, when reading pg_dumpall output, it could be that the schemas don't exist yet, but eventually will.) ALTER USER SET has a similar issue. So, reduce the normal ERROR to a NOTICE when checking search_path values for these commands. Supporting this requires changing the API for GUC assign_hook functions, which causes the patch to touch a lot of places, but the changes are conceptually trivial.
2003-12-21Back out:Bruce Momjian
> Attached is a patch that addressed all the discussed issues > that did not break backward compatability, including the > ability to output ISO-8601 compliant intervals by setting > datestyle to iso8601basic.
2003-12-20In my mind there were two categories of open issuesBruce Momjian
a) ones that are 100% backward (such as the comment about outputting this format) and b) ones that aren't (such as deprecating the current postgresql shorthand of '1Y1M'::interval = 1 year 1 minute in favor of the ISO-8601 'P1Y1M'::interval = 1 year 1 month. Attached is a patch that addressed all the discussed issues that did not break backward compatability, including the ability to output ISO-8601 compliant intervals by setting datestyle to iso8601basic. Interval values can now be written as ISO 8601 time intervals, using the "Format with time-unit designators". This format always starts with the character 'P', followed by a string of values followed by single character time-unit designators. A 'T' separates the date and time parts of the interval. Ron Mayer
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-11-06Implement isolation levels read uncommitted and repeatable read as actingPeter Eisentraut
like the next higher one.
2003-09-25Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut
terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
2003-08-04Update copyrights to 2003.Bruce Momjian
2003-08-04pgindent run.Bruce Momjian
2003-07-29Apply (a somewhat revised version of) Greg Mullane's patch to eliminateTom Lane
heuristic determination of day vs month in date/time input. Add the ability to specify that input is interpreted as yy-mm-dd order (which formerly worked, but only for yy greater than 31). DateStyle's input component now has the preferred spellings DMY, MDY, or YMD; the older keywords European and US are now aliases for the first two of these. Per recent discussions on pgsql-general.
2003-07-28A visit from the message-style police ...Tom Lane
2003-07-20Another round of error message editing, covering backend/commands/.Tom Lane
2003-07-17Make EXTRACT(TIMEZONE) and SET/SHOW TIMEZONE follow the SQL conventionTom Lane
for the sign of timezone offsets, ie, positive is east from UTC. These were previously out of step with other operations that accept or show timezones, such as I/O of timestamptz values.
2003-07-15Now that I look, SHOW TRANSACTION_ISOLATION isn't quite consistentTom Lane
with SET TRANSACTION_ISOLATION, either.
2003-07-15Cause SHOW DATESTYLE to produce a string that will be accepted by SETTom Lane
DATESTYLE, for instance 'SQL, European' instead of 'SQL with European conventions'. Per gripe a month or two back from Barry Lind.
2003-06-27Add is_superuser parameter reporting, soon to be used by psql.Tom Lane
2003-06-06Add defense in assign_session_authorization() against trying to doTom Lane
catalog lookups when not in a transaction. This prevents bizarre failures if someone tries to set a value for session_authorization in postgresql.conf. Per report from Fernando Nasser.
2003-05-22Add defense against possibility that tzname[] doesn't exist.Tom Lane
2003-05-18Add code to test for unknown timezone names (following some ideas fromTom Lane
Ross Reedstrom, a couple months back) and to detect timezones that are using leap-second timekeeping. The unknown-zone-name test is pretty heuristic and ugly, but it seems better than the old behavior of just switching to GMT given a bad name. Also make DecodePosixTimezone() a tad more robust.
2003-04-27Clean up some problems in SetClientEncoding: failed to honor doit flagTom Lane
in all cases, leaked TopMemoryContext memory in others. Make the interaction between SetClientEncoding and InitializeClientEncoding cleaner and better documented. I suspect these changes should be back-patched into 7.3, but will wait on Tatsuo's verification.
2003-04-25In the continuing saga of FE/BE protocol revisions, add reporting ofTom Lane
initial values and runtime changes in selected parameters. This gets rid of the need for an initial 'select pg_client_encoding()' query in libpq, bringing us back to one message transmitted in each direction for a standard connection startup. To allow server version to be sent using the same GUC mechanism that handles other parameters, invent the concept of a never-settable GUC parameter: you can 'show server_version' but it's not settable by any GUC input source. Create 'lc_collate' and 'lc_ctype' never-settable parameters so that people can find out these settings without need for pg_controldata. (These side ideas were all discussed some time ago in pgsql-hackers, but not yet implemented.)
2003-02-01Fix assign_session_authorization() to not be confused by all-numericTom Lane
user names. Per recent reports.
2002-12-05More cleanup of userid to be AclId rather than Oid.Bruce Momjian
2002-09-04pgindent run.Bruce Momjian
2002-07-18I have committed many support files for CREATE CONVERSION. DefaultTatsuo Ishii
conversion procs and conversions are added in initdb. Currently supported conversions are: UTF-8(UNICODE) <--> SQL_ASCII, ISO-8859-1 to 16, EUC_JP, EUC_KR, EUC_CN, EUC_TW, SJIS, BIG5, GBK, GB18030, UHC, JOHAB, TCVN EUC_JP <--> SJIS EUC_TW <--> BIG5 MULE_INTERNAL <--> EUC_JP, SJIS, EUC_TW, BIG5 Note that initial contents of pg_conversion system catalog are created in the initdb process. So doing initdb required is ideal, it's possible to add them to your databases by hand, however. To accomplish this: psql -f your_postgresql_install_path/share/conversion_create.sql your_database So I did not bump up the version in cataversion.h. TODO: Add more conversion procs Add [CASCADE|RESTRICT] to DROP CONVERSION Add tuples to pg_depend Add regression tests Write docs Add SQL99 CONVERT command? -- Tatsuo Ishii
2002-06-20Update copyright to 2002.Bruce Momjian
2002-06-11Katherine Ward wrote:Jan Wieck
> Changes to avoid collisions with WIN32 & MFC names... > 1. Renamed: > a. PROC => PGPROC > b. GetUserName() => GetUserNameFromId() > c. GetCurrentTime() => GetCurrentDateTime() > d. IGNORE => IGNORE_DTF in include/utils/datetime.h & utils/adt/datetim > > 2. Added _P to some lex/yacc tokens: > CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT Jan
2002-05-17Merge the last few variable.c configuration variables into the genericTom Lane
GUC support. It's now possible to set datestyle, timezone, and client_encoding from postgresql.conf and per-database or per-user settings. Also, implement rollback of SET commands that occur in a transaction that later fails. Create a SET LOCAL var = value syntax that sets the variable only for the duration of the current transaction. All per previous discussions in pghackers.
2002-05-06Accept SET SESSION AUTHORIZATION DEFAULT and RESET SESSION AUTHORIZATIONTom Lane
to reset session userid to the originally-authenticated name. Also, relax SET SESSION AUTHORIZATION to allow specifying one's own username even if one is not superuser, so as to avoid unnecessary error messages when loading a pg_dump file that uses this command. Per discussion from several months ago.
2002-04-22Convert GUC parameters back to strings if input as integers.Thomas G. Lockhart
Change elog(ERROR) messages to say that a variable takes one parameter, rather than saying that it does not take multiple parameters.
2002-04-22Check for multiple arguments on parameters which do not allow them.Thomas G. Lockhart
The last version caught this with an assert because I wasn't sure whether we should elog(ERROR) or just loop through the parameters.