Commit Graph

33 Commits

Author SHA1 Message Date
Jan Wieck be948af2e8 Added LIMIT/OFFSET functionality including new regression test for it.
Removed CURRENT keyword for rule queries and changed rules regression
accordingly. CURRENT has beed announced to disappear in v6.5.

Jan
1999-02-08 14:14:32 +00:00
Jan Wieck 28d8b42ca5 Speedup of PL/pgSQL by calling ExecEvalExpr() directly
instead of SPI_execp() for simple expressions.

Jan
1999-01-27 16:15:22 +00:00
Tom Lane 422221c90d Another SELECT speedup: extract OIDs of column print functions
only once per SELECT, not once per tuple.  10% here, 10% there,
pretty soon you're talking about real speedups ...
1999-01-27 00:36:28 +00:00
Tom Lane d03e98737c Replace typtoout() and gettypelem() with a single routine,
so that fetching an attribute value needs only one SearchSysCacheTuple call
instead of two redundant searches.  This speeds up a large SELECT by about
ten percent, and probably will help GROUP BY and SELECT DISTINCT too.
1999-01-24 05:40:49 +00:00
Marc G. Fournier 7c3b7d2744 Initial attempt to clean up the code...
Switch sprintf() to snprintf()
Remove any/all #if 0 -or- #ifdef NOT_USED -or- #ifdef FALSE sections of
	code
1998-12-14 05:19:16 +00:00
Vadim B. Mikheev 6beba218d7 New HeapTuple structure/interface. 1998-11-27 19:52:36 +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 15cb32d93e This is the final state of the rule system for 6.4 after the
patch is applied:

	Rewrite rules on relation level work fine now.

	Event qualifications on insert/update/delete  rules  work
	fine now.

	I  added  the  new  keyword  OLD to reference the CURRENT
	tuple. CURRENT will be removed in 6.5.

	Update rules can  reference  NEW  and  OLD  in  the  rule
	qualification and the actions.

	Insert/update/delete rules on views can be established to
	let them behave like real tables.

	For  insert/update/delete  rules  multiple  actions   are
	supported  now.   The  actions  can also be surrounded by
	parantheses to make psql  happy.   Multiple  actions  are
	required if update to a view requires updates to multiple
	tables.

	Regular users  are  permitted  to  create/drop  rules  on
	tables     they     have     RULE     permissions     for
	(DefineQueryRewrite() is  now  able  to  get  around  the
	access  restrictions  on  pg_rewrite).  This enables view
	creation for regular users too. This  required  an  extra
	boolean  parameter  to  pg_parse_and_plan() that tells to
	set skipAcl on all rangetable entries  of  the  resulting
	queries.       There      is      a      new     function
	pg_exec_query_acl_override()  that  could  be   used   by
	backend utilities to use this facility.

	All rule actions (not only views) inherit the permissions
	of the event relations  owner.  Sample:  User  A  creates
	tables    T1    and    T2,   creates   rules   that   log
	INSERT/UPDATE/DELETE on T1 in T2 (like in the  regression
	tests  for rules I created) and grants ALL but RULE on T1
	to user B.  User B  can  now  fully  access  T1  and  the
	logging  happens  in  T2.  But user B cannot access T2 at
	all, only the rule actions can. And due to  missing  RULE
	permissions on T1, user B cannot disable logging.

	Rules  on  the  attribute  level are disabled (they don't
	work properly and since regular users are  now  permitted
	to create rules I decided to disable them).

	Rules  on  select  must have exactly one action that is a
	select (so select rules must be a view definition).

	UPDATE NEW/OLD rules  are  disabled  (still  broken,  but
	triggers can do it).

	There are two new system views (pg_rule and pg_view) that
	show the definition of the rules or views so the db admin
	can  see  what  the  users do. They use two new functions
	pg_get_ruledef() and pg_get_viewdef() that are  builtins.

	The functions pg_get_ruledef() and pg_get_viewdef() could
	be used to implement rule and view support in pg_dump.

	PostgreSQL is now the only database system I  know,  that
	has rewrite rules on the query level. All others (where I
	found a  rule  statement  at  all)  use  stored  database
	procedures  or  the  like  (triggers as we call them) for
	active rules (as some call them).

    Future of the rule system:

	The now disabled parts  of  the  rule  system  (attribute
	level,  multiple  actions on select and update new stuff)
	require a complete new rewrite handler from scratch.  The
	old one is too badly wired up.

	After  6.4  I'll  start to work on a new rewrite handler,
	that fully supports the attribute level  rules,  multiple
	actions on select and update new.  This will be available
	for 6.5 so we get full rewrite rule capabilities.

Jan
1998-08-24 01:38:11 +00:00
Bruce Momjian 7971539020 heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan;
	descriptor; bootstrap can create multi-key indexes;
pg_procname index now is multi-key index; oidint2, oidint4, oidname
are gone (must be removed from regression tests); use System Cache
rather than sequential scan in many places; heap_modifytuple no
longer takes buffer parameter; remove unused buffer parameter in
a few other functions; oid8 is not index-able; remove some use of
single-character variable names; cleanup Buffer variables usage
and scan descriptor looping; cleaned up allocation and freeing of
tuples; 18k lines of diff;
1998-08-19 02:04:17 +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 0386a50f31 Pass around typmod as int16. 1998-02-10 16:04:38 +00:00
Bruce Momjian 2c482cdbf2 Pass attypmod through to executor by adding to Var and Resdom. 1998-02-10 04:02:59 +00:00
Bruce Momjian 726c3854cb Inline fastgetattr and others so data access does not use function
calls.
1998-01-31 04:39:26 +00:00
Bruce Momjian c60f70b53f Rename pg_plan and pg_eval to be more meaningful. 1997-12-11 17:36:58 +00:00
Bruce Momjian 4a5b781d71 Break parser functions into smaller files, group together. 1997-11-25 22:07:18 +00:00
Vadim B. Mikheev 3f6381d7e7 Fix error indicator for SPI_getvalue() and SPI_getbinval() 1997-09-29 06:28:45 +00:00
Vadim B. Mikheev 561b35e556 Return error if char *query is null in SPI_prepare() 1997-09-26 13:57:39 +00:00
Vadim B. Mikheev bb0cc20e64 Fix handling of SPI_tuptable. 1997-09-25 12:16:05 +00:00
Thomas G. Lockhart 0e699286d3 Coerce type of NULL pointer return to suppress gcc compiler warnings. 1997-09-24 17:45:21 +00:00
Vadim B. Mikheev eec6108650 + SPI_palloc(), SPI_repalloc(), SPI_pfree() - for allocations
in upper Executor memory context.
1997-09-24 08:28:37 +00:00
Vadim B. Mikheev 4587547f13 Added: SPI_copytuple() & SPI_modifytuple() 1997-09-12 08:37:52 +00:00
Vadim B. Mikheev fd3ad7d765 Allow to call utility funcs without SPI_connect. 1997-09-12 05:11:14 +00:00
Bruce Momjian 1ea01720d5 heapattr functions now return a Datum, not char *. 1997-09-12 04:09:08 +00:00
Vadim B. Mikheev 6e04b4b20f Use strcasecmp in SPI_fnumber(TupleDesc tupdesc, char *fname). 1997-09-12 02:42:40 +00:00
Vadim B. Mikheev a74613f478 Cleanups. 1997-09-11 07:24:37 +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 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
Vadim B. Mikheev bf1d9aeb97 Cleanups. 1997-09-06 11:23:05 +00:00
Vadim B. Mikheev 78d74e32fb execMain.c: little changes in trigger interface...
spi.c: functions to prepare/run and preserve plans for
       duration of transaction/session. Some data utilities.
1997-09-04 13:22:39 +00:00
Vadim B. Mikheev d65584d297 Get rid of #include "../backend/parser/parse.h 1997-08-31 11:41:20 +00:00
Vadim B. Mikheev 0d0254d1fb SPI manager. 1997-08-29 09:05:57 +00:00