- 04 Aug, 2002 3 commits
-
-
Bruce Momjian authored
types for Table Functions, as previously proposed on HACKERS. Here is a brief explanation: 1. Creates a new pg_type typtype: 'p' for pseudo type (currently either 'b' for base or 'c' for catalog, i.e. a class). 2. Creates new builtin type of typtype='p' named RECORD. This is the first of potentially several pseudo types. 3. Modify FROM clause grammer to accept: SELECT * FROM my_func() AS m(colname1 type1, colname2 type1, ...) where m is the table alias, colname1, etc are the column names, and type1, etc are the column types. 4. When typtype == 'p' and the function return type is RECORD, a list of column defs is required, and when typtype != 'p', it is disallowed. 5. A check was added to ensure that the tupdesc provide via the parser and the actual return tupdesc match in number and type of attributes. When creating a function you can do: CREATE FUNCTION foo(text) RETURNS setof RECORD ... When using it you can do: SELECT * from foo(sqlstmt) AS (f1 int, f2 text, f3 timestamp) or SELECT * from foo(sqlstmt) AS f(f1 int, f2 text, f3 timestamp) or SELECT * from foo(sqlstmt) f(f1 int, f2 text, f3 timestamp) Included in the patches are adjustments to the regression test sql and expected files, and documentation. p.s. This potentially solves (or at least improves) the issue of builtin Table Functions. They can be bootstrapped as returning RECORD, and we can wrap system views around them with properly specified column defs. For example: CREATE VIEW pg_settings AS SELECT s.name, s.setting FROM show_all_settings()AS s(name text, setting text); Then we can also add the UPDATE RULE that I previously posted to pg_settings, and have pg_settings act like a virtual table, allowing settings to be queried and set. Joe Conway
-
Thomas G. Lockhart authored
Can now do queries of the form: SELECT value IS OF (integer, float8); Define macros for handling typmod manipulation for date/time types. Should be more robust than all of that brute-force inline code. Rename macros for masking and typmod manipulation to put TIMESTAMP_ or INTERVAL_ in front of the macro name, to reduce the possibility of name space collisions. Allow bit string constants without fully-specified length declaration. Try implementing CREATE TABLE/OF as a mapping to inheritance. May be appropriate, or may be replace later with something more exactly like one might expect from databases without the feature.
-
Bruce Momjian authored
functionality of the command is basically identical to that of BEGIN; it just accepts a few extra options (only one of which PostgreSQL currently implements), and is standards-compliant. The patch includes a simple regression test and documentation. [ Regression tests removed, per Peter.] Neil Conway
-
- 31 Jul, 2002 1 commit
-
-
Tom Lane authored
attstattarget to indicate 'use the default'. The default is now a GUC variable default_statistics_target, and so may be changed on the fly. Along the way we gain the ability to have pg_dump dump the per-column statistics target when it's not the default. Patch by Neil Conway, with some kibitzing from Tom Lane.
-
- 30 Jul, 2002 1 commit
-
-
Bruce Momjian authored
'tioga recipes', whatever those are -- Peter E. killed most of it a couple days ago, but this patch removes the rest. Most of it was #ifdef'ed out anyway. Neil Conway
-
- 29 Jul, 2002 1 commit
-
-
Tom Lane authored
documentation (xindex.sgml should be rewritten), need to teach pg_dump about it, need to update contrib modules that currently build pg_opclass entries by hand. Original patch by Bill Studenmund, grammar adjustments and general update for 7.3 by Tom Lane.
-
- 24 Jul, 2002 1 commit
-
-
Peter Eisentraut authored
pg_language.lancompiler pg_operator.oprprec pg_operator.oprisleft pg_proc.proimplicit pg_proc.probyte_pct pg_proc.properbyte_cpu pg_proc.propercall_cpu pg_proc.prooutin_ratio pg_shadow.usetrace pg_type.typprtlen pg_type.typreceive pg_type.typsend Attempts to use the obsoleted attributes of pg_operator or pg_proc in the CREATE commands will be greeted by a warning. For pg_type, there is no warning (yet) because pg_dump scripts still contain these attributes. Also remove new but already obsolete spellings isVolatile, isStable, isImmutable in WITH clause. (Use new syntax instead.)
-
- 20 Jul, 2002 1 commit
-
-
Bruce Momjian authored
as a result of Peter's recent CREATE CAST changes. Neil Conway
-
- 18 Jul, 2002 6 commits
-
-
Peter Eisentraut authored
extension to create binary compatible casts. Includes dependency tracking as well. pg_proc.proimplicit is now defunct, but will be removed in a separate commit. pg_dump provides a migration path from the previous scheme to declare casts. Dumping binary compatible casts is currently impossible, though.
-
Bruce Momjian authored
-
Tom Lane authored
operator classes, both of which are schema-local and so should really be droppable.
-
Bruce Momjian authored
COPY x (a,d,c,b) from stdin; COPY x (a,c) to stdout; as well as the corresponding changes to pg_dump to use the new functionality. This functionality is not available when using the BINARY option. If a column is not specified in the COPY FROM statement, its default values will be used. In addition to this functionality, I tweaked a couple of the error messages emitted by the new COPY <options> checks. Brent Verner
-
Bruce Momjian authored
Implements between (symmetric / asymmetric) as a node. Executes the left or right expression once, makes a Const out of the resulting Datum and executes the >=, <= portions out of the Const sets. Of course, the parser does a fair amount of preparatory work for this to happen. Rod Taylor
-
Tatsuo Ishii authored
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
-
- 16 Jul, 2002 1 commit
-
-
Tom Lane authored
functionality. Of note: dropping a table that has a SERIAL column defined now drops the associated sequence automatically.
-
- 14 Jul, 2002 1 commit
-
-
Tom Lane authored
Fix comment.c to not depend on parser token values, per discussion awhile back.
-
- 12 Jul, 2002 1 commit
-
-
Tom Lane authored
pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY constraints all have real live entries in pg_constraint. pg_depend exists, and RESTRICT/CASCADE options work on most kinds of DROP; however, pg_depend is not yet very well populated with dependencies. (Most of the ones that are present at this point just replace formerly hardwired associations, such as the implicit drop of a relation's pg_type entry when the relation is dropped.) Need to add more logic to create dependency entries, improve pg_dump to dump constraints in place of indexes and triggers, and add some regression tests.
-
- 11 Jul, 2002 1 commit
-
-
Tatsuo Ishii authored
This is the first cut toward CREATE CONVERSION/DROP CONVERSION implementaion. The commands can now add/remove tuples to the new pg_conversion system catalog, but that's all. Still need work to make them actually working. Documentations, regression tests also need work.
-
- 06 Jul, 2002 1 commit
-
-
Bruce Momjian authored
are managed as per request. Moved from merging with table attributes to applying themselves during coerce_type() and coerce_type_typmod. Regression tests altered to test the cast() scenarios. Rod Taylor
-
- 04 Jul, 2002 1 commit
-
-
Thomas G. Lockhart authored
Reused the Expr node to hold DISTINCT which strongly resembles the existing OP info. Define DISTINCT_EXPR which strongly resembles the existing OPER_EXPR opType, but with handling for NULLs required by SQL99. We have explicit support for single-element DISTINCT comparisons all the way through to the executor. But, multi-element DISTINCTs are handled by expanding into a comparison tree in gram.y as is done for other row comparisons. Per discussions, it might be desirable to move this into one or more purpose-built nodes to be handled in the backend. Define the optional ROW keyword and token per SQL99. This allows single-element row constructs, which were formerly disallowed due to shift/reduce conflicts with parenthesized a_expr clauses. Define the SQL99 TREAT() function. Currently, use as a synonym for CAST().
-
- 01 Jul, 2002 1 commit
-
-
Tom Lane authored
RESTRICT/CASCADE syntax to the DROP commands that need it, and propagates the behavioral option through the parser to the routines that execute drops. Doesn't do anything useful yet, but I figured I'd commit these changes so I could get out of the parser area while working on the rest.
-
- 22 Jun, 2002 1 commit
-
-
Thomas G. Lockhart authored
Also implement alternative forms to expose the PostgreSQL CREATE FUNCTION features. Implement syntax for READ ONLY and READ WRITE clauses in SET TRANSACTION. READ WRITE is already implemented (of course). Implement syntax for "LIKE table" clause in CREATE TABLE. Should be fairly easy to complete since it resembles SELECT INTO. Implement MATCH SIMPLE clause for foreign key definitions. This is explicit SQL99 syntax for the default behavior, so we now support it :) Start implementation of shorthand for national character literals in scanner. For now, just swallow the leading "N", but sometime soon let's figure out how to pass leading type info from the scanner to the parser. We should use the same technique for binary and hex bit string literals, though it might be unusual to have two apparently independent literal types fold into the same storage type.
-
- 20 Jun, 2002 2 commits
-
-
Bruce Momjian authored
-
Bruce Momjian authored
-
- 19 Jun, 2002 1 commit
-
-
Bruce Momjian authored
-
- 18 Jun, 2002 3 commits
-
-
Bruce Momjian authored
-
Bruce Momjian authored
members in gram.y. This is the prefered method for WITH and arbitrary param/value pairs.
-
Bruce Momjian authored
-
- 17 Jun, 2002 4 commits
-
-
Bruce Momjian authored
opt_with and from_in.
-
Bruce Momjian authored
-
Bruce Momjian authored
-
Bruce Momjian authored
GROUP. Make WITH optional in CREATE DATABASE for consistency.
-
- 15 Jun, 2002 1 commit
-
-
Thomas G. Lockhart authored
Remove ODBC-compatible empty parentheses from calls to SQL99 functions for which these parentheses do not match the standard. Update the ODBC driver to ensure compatibility with the ODBC standard for these functions (e.g. CURRENT_TIMESTAMP, CURRENT_USER, etc). Include a new appendix in the User's Guide which lists the labeled features for SQL99 (the labeled features replaced the "basic", "intermediate", and "advanced" categories from SQL92). features.sgml does not yet split this list into "supported" and "unsupported" lists.
-
- 13 Jun, 2002 1 commit
-
-
Thomas G. Lockhart authored
update to support the new OVERLAY() function.
-
- 11 Jun, 2002 2 commits
-
-
Thomas G. Lockhart authored
Implement SQL99 SIMILAR TO as a synonym for our existing operator "~". Implement SQL99 regular expression SUBSTRING(string FROM pat FOR escape). Extend the definition to make the FOR clause optional. Define textregexsubstr() to actually implement this feature. Update the regression test to include these new string features. All tests pass. Rename the regular expression support routines from "pg95_xxx" to "pg_xxx". Define CREATE CHARACTER SET in the parser per SQL99. No implementation yet.
-
Jan Wieck authored
> 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
-
- 22 May, 2002 1 commit
-
-
Peter Eisentraut authored
function body (and other properties) as a function in the language is created. This generalizes ad hoc code that already existed for the built-in languages. The validation now happens after the pg_proc tuple of the new function is created, so it is possible to define recursive SQL functions. Add some regression test cases that cover bogus function definition attempts.
-
- 19 May, 2002 1 commit
-
-
Peter Eisentraut authored
in the various standards can be found in the documentation these days.
-
- 17 May, 2002 2 commits
-
-
Peter Eisentraut authored
-
Tom Lane authored
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.
-