TO_DATE()
and PgSQL extension FROM_CHAR().
TO_CHAR() routine allow formating text output with a datetime values:
SELECT TO_CHAR('now'::datetime, '"Now is: "HH24:MI:SS');
to_char
----------------
Now is: 21:04:10
FROM_CHAR() routine allow convert text to a datetime:
SELECT FROM_CHAR('September 1999 10:20:30', 'FMMonth YYYY
HH:MI:SS');
from_char
-----------------------------
Wed Sep 01 10:20:30 1999 CEST
TO_DATE() is equal with FROM_CHAR(), but output a Date only:
SELECT TO_DATE('September 1999 10:20:30', 'FMMonth YYYY
HH:MI:SS');
to_date
----------
09-01-1999
In attache is compressed dir for the contrib. All is prepared, but I'am
not
sure if Makefile is good (probably yes).
Comments & suggestions ?
Thomas, thank you for your good advices.
Karel
------------------------------------------------------------------------------
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
additional argument specifying the kind of lock to acquire/release (or
'NoLock' to do no lock processing). Ensure that all relations are locked
with some appropriate lock level before being examined --- this ensures
that relevant shared-inval messages have been processed and should prevent
problems caused by concurrent VACUUM. Fix several bugs having to do with
mismatched increment/decrement of relation ref count and mismatched
heap_open/close (which amounts to the same thing). A bogus ref count on
a relation doesn't matter much *unless* a SI Inval message happens to
arrive at the wrong time, which is probably why we got away with this
sloppiness for so long. Repair missing grab of AccessExclusiveLock in
DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
Recommend 'make clean all' after pulling this update; I modified the
Relation struct layout slightly.
Will post further discussion to pghackers list shortly.
I have updated my contrib code for version 6.5. In the attachment you will
find the directories array, datetime, miscutil, string, tools and userlocks
which replace the corresponding directories under contrib.
In contrib/tools you will find some developement scripts which I use while
hacking the sources. I hope they will be useful for some other people.
I have also added a contrib/Makefile which tries to compile and install all
the contribs. Unfortunately many of them don't have a Makefile or don't
compile cleanly.
--
Massimo Dal Zotto
{
Oid relId;
Oid dbId;
union
{
BlockNumber blkno;
TransactionId xid;
} objId;
>
> Added:
> /*
> * offnum should be part of objId.tupleId above, but would increase
> * sizeof(LOCKTAG) and so moved here; currently used by userlocks only.
> */
> OffsetNumber offnum;
uint16 lockmethod; /* needed by userlocks */
} LOCKTAG;
gmake clean required...
User locks are ready for 6.5 release...
The
offending code
has been removed, the action is now always dependent :-)
I suggest the following patch, to finally make trigger regression happy
again:
<<refint1.patch>>
After that you can remove the following from TODO:
Remove ERROR: check_primary_key: even number of arguments should be
specified
Trigger regression test fails
Andreas
works with a new policy in cascade mode .
Please Read README.MAX .
I do not know if you are the author of refint.c ,
but if not please tell me who is .
Thank you ( excuse me for my bad english) .
Massimo Lambertini massimo.lambertini@everex.it
to postgres.init.sh , clairify the options
available, and to add easy support
for installation of postgres into the
runlevel system.
"sh postgres.init.sh install"
Will now install "postgres" in the
/etc/rc.d/init.d directory and execute
/sbin/chkconfig to hook up the symbolic
links. An uninstall option is also added.
Enclosed is the patch and the patched file
Clark
I've changed the check_primary_key() function code to allow for either
the "automatic insert key rule" or "dependent insert key rule".
Previously it restricted the addtion of a child entry if the
corresponding parent entry was not there. Now if the option is
"automatic" it will add an entry in the parent too ( it will be
successful if there are no no-null fields in the parent apart from the
primary key).
The way to use it now is:
:/*
* check_primary_key () -- check that key in tuple being
inserted/updated
* references existing tuple in "primary" table.
* Though it's called without args You have to specify referenced
* table/keys while creating trigger: key field names in triggered
table,
* referenced table name, referenced key field names,type of action
[automatic|dependent]:
* EXECUTE PROCEDURE
* check_primary_key ('Fkey1', 'Fkey2', 'Ptable', 'Pkey1', 'Pkey2',
'[automatic|dependent]').
*/
I am attaching the new ../contrib/spi/refint.c file which will do this.
I will be glad to help in case of any problems.
- Anand.
> > the standard distribution. It occurs when a trigger calling this
> > function recursively fires another trigger which calls the same
> > function. The calling check_foreign_key loses its plan informantion and
> > when it tries to use it the backend closes its channel. You can check it
> > with the sql script I am attaching below.
> > The solution to this is to do a find_plan again before executing it at
> > line 483 of refint.c.
> > Therefore two more lines should be added before line 483:
Anand Surelia
Here is a tar file the new directories, which substitute the old ones
in contrib. Please remove the old directories array, datetime, miscutil,
string and userlock before unpacking the tar file in contrib.
Note that as the modules are now installed in lib/modules I install all
my sql code in lib/sql. In my opinion also the other contributors should
follow these rules.
test isn't that complete up to now, but I think it shows
enough of the capabilities of the module.
The Makefile assumes it is located in a directory under
pgsql/src/pl. Since it includes Makefile.global and
Makefile.port and doesn't use any own compiler/linker calls,
it should build on most of our supported platforms (I only
tested under Linux up to now). It requires flex and bison I
think. Maybe we should ship prepared gram.c etc. like for the
main parser too?
Jan
Here is some more contrib-fodder, based on TIH's IP address type,
for ISBN and ISSN identifiers (which I just happened to need to keep
track of the things in my library).
inclusion in pgsql. I have included a README which should be enough
to start using it, plus a BENCH file that describes some timings
I have done.
Please have a look at it, and if you think everything is OK, I
would like it seen included in the contrib-section of pgsql.
I don't think I will do any more work in this, but maybe it inspires
somebody else to improve on it.
Maarten Boekhold