1. 22 Jan, 2000 1 commit
  2. 20 Jan, 2000 1 commit
    • Tom Lane's avatar
      Assign a typmod of -1 to unadorned CHAR and NUMERIC type specs. This · 7476e371
      Tom Lane authored
      allows casts without specific length requirements to continue to work
      as they did before; that is, x::char will not truncate the value of x,
      whereas x::char(1) will.  Likewise for NUMERIC precision/scale.
      The column length defaults of char(1) and numeric(30,6) are now inserted
      in analyze.c's processing of CREATE TABLE.
      7476e371
  3. 18 Jan, 2000 3 commits
  4. 17 Jan, 2000 1 commit
  5. 16 Jan, 2000 1 commit
  6. 15 Jan, 2000 1 commit
  7. 14 Jan, 2000 1 commit
    • Peter Eisentraut's avatar
      * User management commands no longer user pg_exec_query_dest -> more robust · 4ceb2d0c
      Peter Eisentraut authored
      * Let unprivileged users change their own passwords.
      
      * The password is now an Sconst in the parser, which better reflects its text datatype and also
      forces users to quote them.
      
      * If your password is NULL you won't be written to the password file, meaning you can't connect
      until you have a password set up (if you use password authentication).
      
      * When you drop a user that owns a database you get an error. The database is not gone.
      4ceb2d0c
  8. 13 Jan, 2000 1 commit
  9. 16 Dec, 1999 1 commit
  10. 14 Dec, 1999 1 commit
    • Bruce Momjian's avatar
      Depending on my interpreting (and programming) skills, this might solve · bcaabc56
      Bruce Momjian authored
      anywhere from zero to two TODO items.
      
      * Allow flag to control COPY input/output of NULLs
      
      I got this:
      COPY table .... [ WITH NULL AS 'string' ]
      which does what you'd expect. The default is \N, otherwise you can use
      empty strings, etc. On Copy In this acts like a filter: every data item
      that looks like 'string' becomes a NULL. Pretty straightforward.
      
      This also seems to be related to
      
      * Make postgres user have a password by default
      
      If I recall this discussion correctly, the problem was actually that the
      default password for the postgres (or any) user is in fact "\N", because
      of the way copy is used. With this change, the file pg_pwd is copied out
      with nulls as empty strings, so if someone doesn't have a password, the
      password is just '', which one would expect from a new account. I don't
      think anyone really wants a hard-coded default password.
      
      Peter Eisentraut                  Sernanders väg 10:115
      bcaabc56
  11. 10 Dec, 1999 4 commits
  12. 06 Dec, 1999 1 commit
    • Jan Wieck's avatar
      Completed FOREIGN KEY syntax. · b8ef7e7f
      Jan Wieck authored
      Added functionality for automatic trigger creation during CREATE TABLE.
      
      Added ON DELETE RESTRICT and some others.
      
      Jan
      b8ef7e7f
  13. 30 Nov, 1999 1 commit
    • Bruce Momjian's avatar
      create/alter user extension · eebfb9ba
      Bruce Momjian authored
      This one should work much better than the one I sent in previously. The
      functionality is the same, but the patch was missing one file resulting
      in
      the compilation failing. The docs also received a minor fix.
      
      Peter Eisentraut                  Sernanders väg 10:115
      eebfb9ba
  14. 20 Nov, 1999 1 commit
    • Tom Lane's avatar
      Fix problems with CURRENT_DATE and related functions being used in · ea4ae108
      Tom Lane authored
      table defaults or rules: translate them to a function call so that
      parse_coerce doesn't reduce them to a date or time constant immediately.
      Also, eliminate a lot of redundancy in the expression grammar by
      defining a new nonterminal com_expr, which contains all the productions
      that can be shared by a_expr and b_expr.
      ea4ae108
  15. 15 Nov, 1999 1 commit
    • Tom Lane's avatar
      Implement subselects in target lists. Also, relax requirement that · f68e11f3
      Tom Lane authored
      subselects can only appear on the righthand side of a binary operator.
      That's still true for quantified predicates like x = ANY (SELECT ...),
      but a subselect that delivers a single result can now appear anywhere
      in an expression.  This is implemented by changing EXPR_SUBLINK sublinks
      to represent just the (SELECT ...) expression, without any 'left hand
      side' or combining operator --- so they're now more like EXISTS_SUBLINK.
      To handle the case of '(x, y, z) = (SELECT ...)', I added a new sublink
      type MULTIEXPR_SUBLINK, which acts just like EXPR_SUBLINK used to.
      But the grammar will only generate one for a multiple-left-hand-side
      row expression.
      f68e11f3
  16. 29 Oct, 1999 2 commits
  17. 26 Oct, 1999 2 commits
    • Bruce Momjian's avatar
      Fix compile after COMMENT problem. · d426869b
      Bruce Momjian authored
      d426869b
    • Bruce Momjian's avatar
      Hello. · 577e21b3
      Bruce Momjian authored
      The following patch extends the COMMENT ON functionality to the
      rest of the database objects beyond just tables, columns, and views. The
      grammer of the COMMENT ON statement now looks like:
      
      COMMENT ON [
        [ DATABASE | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ] <objname>
      |
      
        COLUMN <relation>.<attribute> |
        AGGREGATE <aggname> <aggtype> |
        FUNCTION <funcname> (arg1, arg2, ...) |
        OPERATOR <op> (leftoperand_typ rightoperand_typ) |
        TRIGGER <triggername> ON relname>
      
      Mike Mascari
      (mascarim@yahoo.com)
      577e21b3
  18. 15 Oct, 1999 1 commit
    • Bruce Momjian's avatar
      This patch implements ORACLE's COMMENT SQL command. · 7acc2377
      Bruce Momjian authored
      >From the ORACLE 7 SQL Language Reference Manual:
      -----------------------------------------------------
      COMMENT
      
      Purpose:
      
      To add a comment about a table, view, snapshot, or
      column into the data dictionary.
      
      Prerequisites:
      
      The table, view, or snapshot must be in your own
      schema
      or you must have COMMENT ANY TABLE system privilege.
      
      Syntax:
      
      COMMENT ON [ TABLE table ] |
                 [ COLUMN table.column] IS 'text'
      
      You can effectively drop a comment from the database
      by setting it to the empty string ''.
      -----------------------------------------------------
      
      Example:
      
      COMMENT ON TABLE workorders IS
         'Maintains base records for workorder information';
      
      COMMENT ON COLUMN workorders.hours IS
         'Number of hours the engineer worked on the task';
      
      to drop a comment:
      
      COMMENT ON COLUMN workorders.hours IS '';
      
      The current patch will simply perform the insert into
      pg_description, as per the TODO. And, of course, when
      the table is dropped, any comments relating to it
      or any of its attributes are also dropped. I haven't
      looked at the ODBC source yet, but I do know from
      an ODBC client standpoint that the standard does
      support the notion of table and column comments.
      Hopefully the ODBC driver is already fetching these
      values from pg_description, but if not, it should be
      trivial.
      
      Hope this makes the grade,
      
      Mike Mascari
      (mascarim@yahoo.com)
      7acc2377
  19. 07 Oct, 1999 1 commit
    • Tom Lane's avatar
      Fix planner and rewriter to follow SQL semantics for tables that are · 3eb1c822
      Tom Lane authored
      mentioned in FROM but not elsewhere in the query: such tables should be
      joined over anyway.  Aside from being more standards-compliant, this allows
      removal of some very ugly hacks for COUNT(*) processing.  Also, allow
      HAVING clause without aggregate functions, since SQL does.  Clean up
      CREATE RULE statement-list syntax the same way Bruce just fixed the
      main stmtmulti production.
      CAUTION: addition of a field to RangeTblEntry nodes breaks stored rules;
      you will have to initdb if you have any rules.
      3eb1c822
  20. 05 Oct, 1999 1 commit
  21. 03 Oct, 1999 1 commit
    • Tom Lane's avatar
      Reimplement parsing and storage of default expressions and constraint · eabc714a
      Tom Lane authored
      expressions in CREATE TABLE.  There is no longer an emasculated expression
      syntax for these things; it's full a_expr for constraints, and b_expr
      for defaults (unfortunately the fact that NOT NULL is a part of the
      column constraint syntax causes a shift/reduce conflict if you try a_expr.
      Oh well --- at least parenthesized boolean expressions work now).  Also,
      stored expression for a column default is not pre-coerced to the column
      type; we rely on transformInsertStatement to do that when the default is
      actually used.  This means "f1 datetime default 'now'" behaves the way
      people usually expect it to.
      BTW, all the support code is now there to implement ALTER TABLE ADD
      CONSTRAINT and ALTER TABLE ADD COLUMN with a default value.  I didn't
      actually teach ALTER TABLE to call it, but it wouldn't be much work.
      eabc714a
  22. 02 Oct, 1999 1 commit
    • Tom Lane's avatar
      Allow CREATE FUNCTION's WITH clause to be used for all language types, · 6eb8d255
      Tom Lane authored
      not just C, so that ISCACHABLE attribute can be specified for user-defined
      functions.  Get rid of ParamString node type, which wasn't actually being
      generated by gram.y anymore, even though define.c thought that was what
      it was getting.  Clean up minor bug in dfmgr.c (premature heap_close).
      6eb8d255
  23. 29 Sep, 1999 1 commit
    • Jan Wieck's avatar
      This is part #1 for of the DEFERRED CONSTRAINT TRIGGER support. · 1547ee01
      Jan Wieck authored
      Implements the CREATE CONSTRAINT TRIGGER and SET CONSTRAINTS commands.
      
      TODO:
          Generic builtin trigger procedures
          Automatic execution of appropriate CREATE CONSTRAINT... at CREATE TABLE
          Support of new trigger type in pg_dump
          Swapping of huge # of events to disk
      
      Jan
      1547ee01
  24. 28 Sep, 1999 4 commits
    • Bruce Momjian's avatar
      More cleanup for | and ^. · 8ccebab8
      Bruce Momjian authored
      8ccebab8
    • Bruce Momjian's avatar
      More cleanup for | and ^. · 77bef41c
      Bruce Momjian authored
      77bef41c
    • Bruce Momjian's avatar
      Fix for creation of operator |. · f44c7bad
      Bruce Momjian authored
      f44c7bad
    • Bruce Momjian's avatar
      I have been working with user defined types and user defined c · 9394d62c
      Bruce Momjian authored
      functions.  One problem that I have encountered with the function
      manager is that it does not allow the user to define type conversion
      functions that convert between user types. For instance if mytype1,
      mytype2, and mytype3 are three Postgresql user types, and if I wish to
      define Postgresql conversion functions like
      
      I run into problems, because the Postgresql dynamic loader would look
      for a single link symbol, mytype3, for both pieces of object code.  If
      I just change the name of one of the Postgresql functions (to make the
      symbols distinct), the automatic type conversion that Postgresql uses,
      for example, when matching operators to arguments no longer finds the
      type conversion function.
      
      The solution that I propose, and have implemented in the attatched
      patch extends the CREATE FUNCTION syntax as follows. In the first case
      above I use the link symbol mytype2_to_mytype3 for the link object
      that implements the first conversion function, and define the
      Postgresql operator with the following syntax
      
      The patch includes changes to the parser to include the altered
      syntax, changes to the ProcedureStmt node in nodes/parsenodes.h,
      changes to commands/define.c to handle the extra information in the AS
      clause, and changes to utils/fmgr/dfmgr.c that alter the way that the
      dynamic loader figures out what link symbol to use.  I store the
      string for the link symbol in the prosrc text attribute of the pg_proc
      table which is currently unused in rows that reference dynamically
      loaded
      functions.
      
      
      Bernie Frankpitt
      9394d62c
  25. 23 Sep, 1999 1 commit
  26. 14 Sep, 1999 1 commit
  27. 18 Aug, 1999 1 commit
  28. 28 Jul, 1999 1 commit
  29. 27 Jul, 1999 1 commit
    • Tom Lane's avatar
      First cut at doing LIKE/regex indexing optimization in · 9e7e29e6
      Tom Lane authored
      optimizer rather than parser.  This has many advantages, such as not
      getting fooled by chance uses of operator names ~ and ~~ (the operators
      are identified by OID now), and not creating useless comparison operations
      in contexts where the comparisons will not actually be used as indexquals.
      The new code also recognizes exact-match LIKE and regex patterns, and
      produces an = indexqual instead of >= and <=.
      
      This change does NOT fix the problem with non-ASCII locales: the code
      still doesn't know how to generate an upper bound indexqual for non-ASCII
      collation order.  But it's no worse than before, just the same deficiency
      in a different place...
      
      Also, dike out loc_restrictinfo fields in Plan nodes.  These were doing
      nothing useful in the absence of 'expensive functions' optimization,
      and they took a considerable amount of processing to fill in.
      9e7e29e6
  30. 20 Jul, 1999 1 commit