mirror of
https://github.com/postgres/postgres.git
synced 2025-08-08 06:02:22 +03:00
Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4,
and 8.0. Later releases already patched.
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.10 2004/07/02 00:58:09 joe Exp $
|
# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.10.4.1 2006/05/21 19:57:38 momjian Exp $
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
@@ -437,7 +437,7 @@ sub mirrorInsert($$$$$) {
|
|||||||
if(defined $recordValues{$column}) {
|
if(defined $recordValues{$column}) {
|
||||||
my $quotedValue = $recordValues{$column};
|
my $quotedValue = $recordValues{$column};
|
||||||
$quotedValue =~ s/\\/\\\\/g;
|
$quotedValue =~ s/\\/\\\\/g;
|
||||||
$quotedValue =~ s/'/\\'/g;
|
$quotedValue =~ s/'/''/g;
|
||||||
$valuesQuery .= "'$quotedValue'";
|
$valuesQuery .= "'$quotedValue'";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -617,7 +617,7 @@ sub mirrorUpdate($$$$$) {
|
|||||||
if(defined $currentValue ) {
|
if(defined $currentValue ) {
|
||||||
$quotedValue = $currentValue;
|
$quotedValue = $currentValue;
|
||||||
$quotedValue =~ s/\\/\\\\/g;
|
$quotedValue =~ s/\\/\\\\/g;
|
||||||
$quotedValue =~ s/'/\\'/g;
|
$quotedValue =~ s/'/''/g;
|
||||||
$updateQuery .= "'$quotedValue'";
|
$updateQuery .= "'$quotedValue'";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -639,7 +639,7 @@ sub mirrorUpdate($$$$$) {
|
|||||||
if(defined $currentValue) {
|
if(defined $currentValue) {
|
||||||
$quotedValue = $currentValue;
|
$quotedValue = $currentValue;
|
||||||
$quotedValue =~ s/\\/\\\\/g;
|
$quotedValue =~ s/\\/\\\\/g;
|
||||||
$quotedValue =~ s/'/\\'/g;
|
$quotedValue =~ s/'/''/g;
|
||||||
$updateQuery .= "'$quotedValue'";
|
$updateQuery .= "'$quotedValue'";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* pending.c
|
* pending.c
|
||||||
* $Id: pending.c,v 1.20 2004/09/10 04:31:06 neilc Exp $
|
* $Id: pending.c,v 1.20.4.1 2006/05/21 19:57:38 momjian Exp $
|
||||||
* $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.20 2004/09/10 04:31:06 neilc Exp $
|
* $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.20.4.1 2006/05/21 19:57:38 momjian Exp $
|
||||||
*
|
*
|
||||||
* This file contains a trigger for Postgresql-7.x to record changes to tables
|
* This file contains a trigger for Postgresql-7.x to record changes to tables
|
||||||
* to a pending table for mirroring.
|
* to a pending table for mirroring.
|
||||||
@@ -546,7 +546,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc, Oid tableOid,
|
|||||||
}
|
}
|
||||||
if (*cpUnFormatedPtr == '\\' || *cpUnFormatedPtr == '\'')
|
if (*cpUnFormatedPtr == '\\' || *cpUnFormatedPtr == '\'')
|
||||||
{
|
{
|
||||||
*cpFormatedPtr = '\\';
|
*cpFormatedPtr = *cpUnFormatedPtr;
|
||||||
cpFormatedPtr++;
|
cpFormatedPtr++;
|
||||||
iUsedDataBlock++;
|
iUsedDataBlock++;
|
||||||
}
|
}
|
||||||
|
@@ -46,31 +46,31 @@ SELECT '1 2'::txtidx;
|
|||||||
'1' '2'
|
'1' '2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 2\''::txtidx;
|
SELECT '''1 2'''::txtidx;
|
||||||
txtidx
|
txtidx
|
||||||
--------
|
--------
|
||||||
'1 2'
|
'1 2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\''::txtidx;
|
SELECT '''1 \\''2'''::txtidx;
|
||||||
txtidx
|
txtidx
|
||||||
---------
|
---------
|
||||||
'1 \'2'
|
'1 \'2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\'3'::txtidx;
|
SELECT '''1 \\''2''3'::txtidx;
|
||||||
txtidx
|
txtidx
|
||||||
-------------
|
-------------
|
||||||
'3' '1 \'2'
|
'3' '1 \'2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\' 3'::txtidx;
|
SELECT '''1 \\''2'' 3'::txtidx;
|
||||||
txtidx
|
txtidx
|
||||||
-------------
|
-------------
|
||||||
'3' '1 \'2'
|
'3' '1 \'2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\' \' 3\' 4 '::txtidx;
|
SELECT '''1 \\''2'' '' 3'' 4 '::txtidx;
|
||||||
txtidx
|
txtidx
|
||||||
------------------
|
------------------
|
||||||
'4' ' 3' '1 \'2'
|
'4' ' 3' '1 \'2'
|
||||||
@@ -101,13 +101,13 @@ SELECT ' 1 '::query_txt;
|
|||||||
'1'
|
'1'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 2\''::query_txt;
|
SELECT '''1 2'''::query_txt;
|
||||||
query_txt
|
query_txt
|
||||||
-----------
|
-----------
|
||||||
'1 2'
|
'1 2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\''::query_txt;
|
SELECT '''1 \\''2'''::query_txt;
|
||||||
query_txt
|
query_txt
|
||||||
-----------
|
-----------
|
||||||
'1 \'2'
|
'1 \'2'
|
||||||
@@ -305,7 +305,7 @@ SELECT '1&(2&(4&(5|!6)))'::query_txt;
|
|||||||
'1' & '2' & '4' & ( '5' | !'6' )
|
'1' & '2' & '4' & ( '5' | !'6' )
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::query_txt;
|
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::query_txt;
|
||||||
query_txt
|
query_txt
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
'1' & '2' & ' 4' & ( '|5' | '6 \' !|&' )
|
'1' & '2' & ' 4' & ( '|5' | '6 \' !|&' )
|
||||||
@@ -335,13 +335,13 @@ SELECT ' 1 '::mquery_txt;
|
|||||||
'1'
|
'1'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 2\''::mquery_txt;
|
SELECT '''1 2'''::mquery_txt;
|
||||||
mquery_txt
|
mquery_txt
|
||||||
------------
|
------------
|
||||||
'1' & '2'
|
'1' & '2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\''::mquery_txt;
|
SELECT '''1 \\''2'''::mquery_txt;
|
||||||
mquery_txt
|
mquery_txt
|
||||||
------------
|
------------
|
||||||
'1' & '2'
|
'1' & '2'
|
||||||
@@ -539,7 +539,7 @@ SELECT '1&(2&(4&(5|!6)))'::mquery_txt;
|
|||||||
'1' & '2' & '4' & ( '5' | !'6' )
|
'1' & '2' & '4' & ( '5' | !'6' )
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::mquery_txt;
|
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::mquery_txt;
|
||||||
mquery_txt
|
mquery_txt
|
||||||
---------------------------------
|
---------------------------------
|
||||||
'1' & '2' & '4' & ( '5' | '6' )
|
'1' & '2' & '4' & ( '5' | '6' )
|
||||||
@@ -698,7 +698,7 @@ SELECT count(*) FROM test_txtidx WHERE a ## '(eq|yt)&(wR|qh)';
|
|||||||
11
|
11
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
SELECT txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty');
|
<i <b> wow < jqw <> qwerty');
|
||||||
txt2txtidx
|
txt2txtidx
|
||||||
@@ -712,7 +712,7 @@ SELECT txtidxsize(txt2txtidx('345 qw'));
|
|||||||
2
|
2
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT txtidxsize(txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
SELECT txtidxsize(txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty'));
|
<i <b> wow < jqw <> qwerty'));
|
||||||
txtidxsize
|
txtidxsize
|
||||||
|
@@ -12,19 +12,19 @@ SELECT '1 '::txtidx;
|
|||||||
SELECT ' 1'::txtidx;
|
SELECT ' 1'::txtidx;
|
||||||
SELECT ' 1 '::txtidx;
|
SELECT ' 1 '::txtidx;
|
||||||
SELECT '1 2'::txtidx;
|
SELECT '1 2'::txtidx;
|
||||||
SELECT '\'1 2\''::txtidx;
|
SELECT '''1 2'''::txtidx;
|
||||||
SELECT '\'1 \\\'2\''::txtidx;
|
SELECT '''1 \\''2'''::txtidx;
|
||||||
SELECT '\'1 \\\'2\'3'::txtidx;
|
SELECT '''1 \\''2''3'::txtidx;
|
||||||
SELECT '\'1 \\\'2\' 3'::txtidx;
|
SELECT '''1 \\''2'' 3'::txtidx;
|
||||||
SELECT '\'1 \\\'2\' \' 3\' 4 '::txtidx;
|
SELECT '''1 \\''2'' '' 3'' 4 '::txtidx;
|
||||||
|
|
||||||
--query_txt
|
--query_txt
|
||||||
SELECT '1'::query_txt;
|
SELECT '1'::query_txt;
|
||||||
SELECT '1 '::query_txt;
|
SELECT '1 '::query_txt;
|
||||||
SELECT ' 1'::query_txt;
|
SELECT ' 1'::query_txt;
|
||||||
SELECT ' 1 '::query_txt;
|
SELECT ' 1 '::query_txt;
|
||||||
SELECT '\'1 2\''::query_txt;
|
SELECT '''1 2'''::query_txt;
|
||||||
SELECT '\'1 \\\'2\''::query_txt;
|
SELECT '''1 \\''2'''::query_txt;
|
||||||
SELECT '!1'::query_txt;
|
SELECT '!1'::query_txt;
|
||||||
SELECT '1|2'::query_txt;
|
SELECT '1|2'::query_txt;
|
||||||
SELECT '1|!2'::query_txt;
|
SELECT '1|!2'::query_txt;
|
||||||
@@ -57,13 +57,13 @@ SELECT '1&(2&(4&(5&6)))'::query_txt;
|
|||||||
SELECT '1&2&4&5&6'::query_txt;
|
SELECT '1&2&4&5&6'::query_txt;
|
||||||
SELECT '1&(2&(4&(5|6)))'::query_txt;
|
SELECT '1&(2&(4&(5|6)))'::query_txt;
|
||||||
SELECT '1&(2&(4&(5|!6)))'::query_txt;
|
SELECT '1&(2&(4&(5|!6)))'::query_txt;
|
||||||
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::query_txt;
|
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::query_txt;
|
||||||
SELECT '1'::mquery_txt;
|
SELECT '1'::mquery_txt;
|
||||||
SELECT '1 '::mquery_txt;
|
SELECT '1 '::mquery_txt;
|
||||||
SELECT ' 1'::mquery_txt;
|
SELECT ' 1'::mquery_txt;
|
||||||
SELECT ' 1 '::mquery_txt;
|
SELECT ' 1 '::mquery_txt;
|
||||||
SELECT '\'1 2\''::mquery_txt;
|
SELECT '''1 2'''::mquery_txt;
|
||||||
SELECT '\'1 \\\'2\''::mquery_txt;
|
SELECT '''1 \\''2'''::mquery_txt;
|
||||||
SELECT '!1'::mquery_txt;
|
SELECT '!1'::mquery_txt;
|
||||||
SELECT '1|2'::mquery_txt;
|
SELECT '1|2'::mquery_txt;
|
||||||
SELECT '1|!2'::mquery_txt;
|
SELECT '1|!2'::mquery_txt;
|
||||||
@@ -96,7 +96,7 @@ SELECT '1&(2&(4&(5&6)))'::mquery_txt;
|
|||||||
SELECT '1&2&4&5&6'::mquery_txt;
|
SELECT '1&2&4&5&6'::mquery_txt;
|
||||||
SELECT '1&(2&(4&(5|6)))'::mquery_txt;
|
SELECT '1&(2&(4&(5|6)))'::mquery_txt;
|
||||||
SELECT '1&(2&(4&(5|!6)))'::mquery_txt;
|
SELECT '1&(2&(4&(5|!6)))'::mquery_txt;
|
||||||
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::mquery_txt;
|
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::mquery_txt;
|
||||||
SELECT 'querty-fgries | http://www.google.com/index.html | www.rambler.ru/index.shtml'::mquery_txt;
|
SELECT 'querty-fgries | http://www.google.com/index.html | www.rambler.ru/index.shtml'::mquery_txt;
|
||||||
|
|
||||||
CREATE TABLE test_txtidx( t text, a txtidx );
|
CREATE TABLE test_txtidx( t text, a txtidx );
|
||||||
@@ -133,13 +133,13 @@ SELECT count(*) FROM test_txtidx WHERE a ## 'eq|yt';
|
|||||||
SELECT count(*) FROM test_txtidx WHERE a ## '(eq&yt)|(wR&qh)';
|
SELECT count(*) FROM test_txtidx WHERE a ## '(eq&yt)|(wR&qh)';
|
||||||
SELECT count(*) FROM test_txtidx WHERE a ## '(eq|yt)&(wR|qh)';
|
SELECT count(*) FROM test_txtidx WHERE a ## '(eq|yt)&(wR|qh)';
|
||||||
|
|
||||||
SELECT txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
SELECT txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty');
|
<i <b> wow < jqw <> qwerty');
|
||||||
|
|
||||||
SELECT txtidxsize(txt2txtidx('345 qw'));
|
SELECT txtidxsize(txt2txtidx('345 qw'));
|
||||||
|
|
||||||
SELECT txtidxsize(txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
SELECT txtidxsize(txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty'));
|
<i <b> wow < jqw <> qwerty'));
|
||||||
|
|
||||||
|
@@ -47,37 +47,37 @@ SELECT '1 2'::tsvector;
|
|||||||
'1' '2'
|
'1' '2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 2\''::tsvector;
|
SELECT '''1 2'''::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
----------
|
----------
|
||||||
'1 2'
|
'1 2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\''::tsvector;
|
SELECT '''1 \\''2'''::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
----------
|
----------
|
||||||
'1 \'2'
|
'1 \'2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\'3'::tsvector;
|
SELECT '''1 \\''2''3'::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
-------------
|
-------------
|
||||||
'3' '1 \'2'
|
'3' '1 \'2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\' 3'::tsvector;
|
SELECT '''1 \\''2'' 3'::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
-------------
|
-------------
|
||||||
'3' '1 \'2'
|
'3' '1 \'2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\' \' 3\' 4 '::tsvector;
|
SELECT '''1 \\''2'' '' 3'' 4 '::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
------------------
|
------------------
|
||||||
'4' ' 3' '1 \'2'
|
'4' ' 3' '1 \'2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
select '\'w\':4A,3B,2C,1D,5 a:8';
|
select '''w'':4A,3B,2C,1D,5 a:8';
|
||||||
?column?
|
?column?
|
||||||
-----------------------
|
-----------------------
|
||||||
'w':4A,3B,2C,1D,5 a:8
|
'w':4A,3B,2C,1D,5 a:8
|
||||||
@@ -126,13 +126,13 @@ SELECT ' 1 '::tsquery;
|
|||||||
'1'
|
'1'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 2\''::tsquery;
|
SELECT '''1 2'''::tsquery;
|
||||||
tsquery
|
tsquery
|
||||||
---------
|
---------
|
||||||
'1 2'
|
'1 2'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'1 \\\'2\''::tsquery;
|
SELECT '''1 \\''2'''::tsquery;
|
||||||
tsquery
|
tsquery
|
||||||
---------
|
---------
|
||||||
'1 \'2'
|
'1 \'2'
|
||||||
@@ -330,13 +330,13 @@ SELECT '1&(2&(4&(5|!6)))'::tsquery;
|
|||||||
'1' & '2' & '4' & ( '5' | !'6' )
|
'1' & '2' & '4' & ( '5' | !'6' )
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::tsquery;
|
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::tsquery;
|
||||||
tsquery
|
tsquery
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
'1' & '2' & ' 4' & ( '|5' | '6 \' !|&' )
|
'1' & '2' & ' 4' & ( '|5' | '6 \' !|&' )
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '\'the wether\':dc & \' sKies \':BC & a:d b:a';
|
SELECT '''the wether'':dc & '' sKies '':BC & a:d b:a';
|
||||||
?column?
|
?column?
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
'the wether':dc & ' sKies ':BC & a:d b:a
|
'the wether':dc & ' sKies ':BC & a:d b:a
|
||||||
@@ -382,7 +382,7 @@ select * from token_type('default');
|
|||||||
23 | entity | HTML Entity
|
23 | entity | HTML Entity
|
||||||
(23 rows)
|
(23 rows)
|
||||||
|
|
||||||
select * from parse('default', '345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
select * from parse('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty');
|
<i <b> wow < jqw <> qwerty');
|
||||||
tokid | token
|
tokid | token
|
||||||
@@ -529,7 +529,7 @@ select * from parse('default', '345 qwe@efd.r \' http://www.com/ http://aew.werc
|
|||||||
1 | qwerty
|
1 | qwerty
|
||||||
(138 rows)
|
(138 rows)
|
||||||
|
|
||||||
SELECT to_tsvector('default', '345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
SELECT to_tsvector('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty');
|
<i <b> wow < jqw <> qwerty');
|
||||||
to_tsvector
|
to_tsvector
|
||||||
@@ -543,7 +543,7 @@ SELECT length(to_tsvector('default', '345 qw'));
|
|||||||
2
|
2
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT length(to_tsvector('default', '345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
SELECT length(to_tsvector('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty'));
|
<i <b> wow < jqw <> qwerty'));
|
||||||
length
|
length
|
||||||
@@ -563,7 +563,7 @@ select to_tsquery('simple', 'qwe & sKies ');
|
|||||||
'qwe' & 'skies'
|
'qwe' & 'skies'
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
select to_tsquery('default', '\'the wether\':dc & \' sKies \':BC ');
|
select to_tsquery('default', '''the wether'':dc & '' sKies '':BC ');
|
||||||
to_tsquery
|
to_tsquery
|
||||||
------------------------
|
------------------------
|
||||||
'wether':CD & 'sky':BC
|
'wether':CD & 'sky':BC
|
||||||
@@ -729,7 +729,7 @@ SELECT count(*) FROM test_tsvector WHERE a @@ to_tsquery('345&qwerty');
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
drop trigger tsvectorupdate on test_tsvector;
|
drop trigger tsvectorupdate on test_tsvector;
|
||||||
create function wow(text) returns text as 'select $1 || \' copyright\'; ' language sql;
|
create function wow(text) returns text as 'select $1 || '' copyright''; ' language sql;
|
||||||
create trigger tsvectorupdate before update or insert on test_tsvector
|
create trigger tsvectorupdate before update or insert on test_tsvector
|
||||||
for each row execute procedure tsearch2(a, wow, t);
|
for each row execute procedure tsearch2(a, wow, t);
|
||||||
insert into test_tsvector (t) values ('345 qwerty');
|
insert into test_tsvector (t) values ('345 qwerty');
|
||||||
|
@@ -12,12 +12,12 @@ SELECT '1 '::tsvector;
|
|||||||
SELECT ' 1'::tsvector;
|
SELECT ' 1'::tsvector;
|
||||||
SELECT ' 1 '::tsvector;
|
SELECT ' 1 '::tsvector;
|
||||||
SELECT '1 2'::tsvector;
|
SELECT '1 2'::tsvector;
|
||||||
SELECT '\'1 2\''::tsvector;
|
SELECT '''1 2'''::tsvector;
|
||||||
SELECT '\'1 \\\'2\''::tsvector;
|
SELECT '''1 \\''2'''::tsvector;
|
||||||
SELECT '\'1 \\\'2\'3'::tsvector;
|
SELECT '''1 \\''2''3'::tsvector;
|
||||||
SELECT '\'1 \\\'2\' 3'::tsvector;
|
SELECT '''1 \\''2'' 3'::tsvector;
|
||||||
SELECT '\'1 \\\'2\' \' 3\' 4 '::tsvector;
|
SELECT '''1 \\''2'' '' 3'' 4 '::tsvector;
|
||||||
select '\'w\':4A,3B,2C,1D,5 a:8';
|
select '''w'':4A,3B,2C,1D,5 a:8';
|
||||||
select 'a:3A b:2a'::tsvector || 'ba:1234 a:1B';
|
select 'a:3A b:2a'::tsvector || 'ba:1234 a:1B';
|
||||||
select setweight('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd zxc:81,567,222A'::tsvector, 'c');
|
select setweight('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd zxc:81,567,222A'::tsvector, 'c');
|
||||||
select strip('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd'::tsvector);
|
select strip('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd'::tsvector);
|
||||||
@@ -28,8 +28,8 @@ SELECT '1'::tsquery;
|
|||||||
SELECT '1 '::tsquery;
|
SELECT '1 '::tsquery;
|
||||||
SELECT ' 1'::tsquery;
|
SELECT ' 1'::tsquery;
|
||||||
SELECT ' 1 '::tsquery;
|
SELECT ' 1 '::tsquery;
|
||||||
SELECT '\'1 2\''::tsquery;
|
SELECT '''1 2'''::tsquery;
|
||||||
SELECT '\'1 \\\'2\''::tsquery;
|
SELECT '''1 \\''2'''::tsquery;
|
||||||
SELECT '!1'::tsquery;
|
SELECT '!1'::tsquery;
|
||||||
SELECT '1|2'::tsquery;
|
SELECT '1|2'::tsquery;
|
||||||
SELECT '1|!2'::tsquery;
|
SELECT '1|!2'::tsquery;
|
||||||
@@ -62,31 +62,31 @@ SELECT '1&(2&(4&(5&6)))'::tsquery;
|
|||||||
SELECT '1&2&4&5&6'::tsquery;
|
SELECT '1&2&4&5&6'::tsquery;
|
||||||
SELECT '1&(2&(4&(5|6)))'::tsquery;
|
SELECT '1&(2&(4&(5|6)))'::tsquery;
|
||||||
SELECT '1&(2&(4&(5|!6)))'::tsquery;
|
SELECT '1&(2&(4&(5|!6)))'::tsquery;
|
||||||
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::tsquery;
|
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::tsquery;
|
||||||
SELECT '\'the wether\':dc & \' sKies \':BC & a:d b:a';
|
SELECT '''the wether'':dc & '' sKies '':BC & a:d b:a';
|
||||||
|
|
||||||
select lexize('simple', 'ASD56 hsdkf');
|
select lexize('simple', 'ASD56 hsdkf');
|
||||||
select lexize('en_stem', 'SKIES Problems identity');
|
select lexize('en_stem', 'SKIES Problems identity');
|
||||||
|
|
||||||
select * from token_type('default');
|
select * from token_type('default');
|
||||||
select * from parse('default', '345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
select * from parse('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty');
|
<i <b> wow < jqw <> qwerty');
|
||||||
|
|
||||||
SELECT to_tsvector('default', '345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
SELECT to_tsvector('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty');
|
<i <b> wow < jqw <> qwerty');
|
||||||
|
|
||||||
SELECT length(to_tsvector('default', '345 qw'));
|
SELECT length(to_tsvector('default', '345 qw'));
|
||||||
|
|
||||||
SELECT length(to_tsvector('default', '345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
SELECT length(to_tsvector('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
|
||||||
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
|
||||||
<i <b> wow < jqw <> qwerty'));
|
<i <b> wow < jqw <> qwerty'));
|
||||||
|
|
||||||
|
|
||||||
select to_tsquery('default', 'qwe & sKies ');
|
select to_tsquery('default', 'qwe & sKies ');
|
||||||
select to_tsquery('simple', 'qwe & sKies ');
|
select to_tsquery('simple', 'qwe & sKies ');
|
||||||
select to_tsquery('default', '\'the wether\':dc & \' sKies \':BC ');
|
select to_tsquery('default', '''the wether'':dc & '' sKies '':BC ');
|
||||||
select to_tsquery('default', 'asd&(and|fghj)');
|
select to_tsquery('default', 'asd&(and|fghj)');
|
||||||
select to_tsquery('default', '(asd&and)|fghj');
|
select to_tsquery('default', '(asd&and)|fghj');
|
||||||
select to_tsquery('default', '(asd&!and)|fghj');
|
select to_tsquery('default', '(asd&!and)|fghj');
|
||||||
@@ -135,7 +135,7 @@ UPDATE test_tsvector SET t = null WHERE t = '345 qwerty';
|
|||||||
SELECT count(*) FROM test_tsvector WHERE a @@ to_tsquery('345&qwerty');
|
SELECT count(*) FROM test_tsvector WHERE a @@ to_tsquery('345&qwerty');
|
||||||
|
|
||||||
drop trigger tsvectorupdate on test_tsvector;
|
drop trigger tsvectorupdate on test_tsvector;
|
||||||
create function wow(text) returns text as 'select $1 || \' copyright\'; ' language sql;
|
create function wow(text) returns text as 'select $1 || '' copyright''; ' language sql;
|
||||||
create trigger tsvectorupdate before update or insert on test_tsvector
|
create trigger tsvectorupdate before update or insert on test_tsvector
|
||||||
for each row execute procedure tsearch2(a, wow, t);
|
for each row execute procedure tsearch2(a, wow, t);
|
||||||
insert into test_tsvector (t) values ('345 qwerty');
|
insert into test_tsvector (t) values ('345 qwerty');
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
* back to source text
|
* back to source text
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.188.4.4 2006/01/26 17:08:34 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.188.4.5 2006/05/21 19:57:39 momjian Exp $
|
||||||
*
|
*
|
||||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||||
*
|
*
|
||||||
@@ -568,7 +568,7 @@ pg_get_triggerdef(PG_FUNCTION_ARGS)
|
|||||||
{
|
{
|
||||||
/* escape quotes and backslashes */
|
/* escape quotes and backslashes */
|
||||||
if (*p == '\'' || *p == '\\')
|
if (*p == '\'' || *p == '\\')
|
||||||
appendStringInfoChar(&buf, '\\');
|
appendStringInfoChar(&buf, *p);
|
||||||
appendStringInfoChar(&buf, *p++);
|
appendStringInfoChar(&buf, *p++);
|
||||||
}
|
}
|
||||||
p++;
|
p++;
|
||||||
@@ -3699,7 +3699,7 @@ get_const_expr(Const *constval, deparse_context *context)
|
|||||||
|
|
||||||
if (ch == '\'' || ch == '\\')
|
if (ch == '\'' || ch == '\\')
|
||||||
{
|
{
|
||||||
appendStringInfoChar(buf, '\\');
|
appendStringInfoChar(buf, ch);
|
||||||
appendStringInfoChar(buf, ch);
|
appendStringInfoChar(buf, ch);
|
||||||
}
|
}
|
||||||
else if (((unsigned char) ch) < ((unsigned char) ' '))
|
else if (((unsigned char) ch) < ((unsigned char) ' '))
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
* Portions taken from FreeBSD.
|
* Portions taken from FreeBSD.
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.73.4.3 2006/02/24 00:54:27 adunstan Exp $
|
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.73.4.4 2006/05/21 19:57:39 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@@ -1955,7 +1955,7 @@ escape_quotes(const char *src)
|
|||||||
for (i = 0, j = 0; i < len; i++)
|
for (i = 0, j = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
if (src[i] == '\'' || src[i] == '\\')
|
if (src[i] == '\'' || src[i] == '\\')
|
||||||
result[j++] = '\\';
|
result[j++] = src[i];
|
||||||
result[j++] = src[i];
|
result[j++] = src[i];
|
||||||
}
|
}
|
||||||
result[j] = '\0';
|
result[j] = '\0';
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
* by PostgreSQL
|
* by PostgreSQL
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.400.4.6 2006/01/09 21:16:37 tgl Exp $
|
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.400.4.7 2006/05/21 19:57:39 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@@ -7553,7 +7553,7 @@ dumpTrigger(Archive *fout, TriggerInfo *tginfo)
|
|||||||
while (s < p)
|
while (s < p)
|
||||||
{
|
{
|
||||||
if (*s == '\'')
|
if (*s == '\'')
|
||||||
appendPQExpBufferChar(query, '\\');
|
appendPQExpBufferChar(query, '\'');
|
||||||
appendPQExpBufferChar(query, *s++);
|
appendPQExpBufferChar(query, *s++);
|
||||||
}
|
}
|
||||||
appendPQExpBufferChar(query, '\'');
|
appendPQExpBufferChar(query, '\'');
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.35 2005/01/01 05:43:08 momjian Exp $
|
* $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.35.4.1 2006/05/21 19:57:39 momjian Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
#include "large_obj.h"
|
#include "large_obj.h"
|
||||||
@@ -178,7 +178,7 @@ do_lo_import(const char *filename_arg, const char *comment_arg)
|
|||||||
for (i = 0; i < slen; i++)
|
for (i = 0; i < slen; i++)
|
||||||
{
|
{
|
||||||
if (comment_arg[i] == '\'' || comment_arg[i] == '\\')
|
if (comment_arg[i] == '\'' || comment_arg[i] == '\\')
|
||||||
*bufptr++ = '\\';
|
*bufptr++ = comment_arg[i];
|
||||||
*bufptr++ = comment_arg[i];
|
*bufptr++ = comment_arg[i];
|
||||||
}
|
}
|
||||||
strcpy(bufptr, "'");
|
strcpy(bufptr, "'");
|
||||||
|
@@ -84,7 +84,7 @@ exec sql end declare section;
|
|||||||
exec sql execute immediate :command;
|
exec sql execute immediate :command;
|
||||||
printf("New tuple got OID = %ld\n", sqlca.sqlerrd[1]);
|
printf("New tuple got OID = %ld\n", sqlca.sqlerrd[1]);
|
||||||
|
|
||||||
sprintf(command, "insert into \"Test\" (name, amount, letter) values ('db: \\\'mm\\\'', 2, 't')");
|
sprintf(command, "insert into \"Test\" (name, amount, letter) values ('db: ''mm''', 2, 't')");
|
||||||
exec sql execute immediate :command;
|
exec sql execute immediate :command;
|
||||||
|
|
||||||
strcpy(msg, "execute insert 2");
|
strcpy(msg, "execute insert 2");
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.166 2004/12/31 22:03:50 pgsql Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.166.4.1 2006/05/21 19:57:39 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@@ -2433,7 +2433,7 @@ PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t *bytealen)
|
|||||||
}
|
}
|
||||||
else if (*vp == '\'')
|
else if (*vp == '\'')
|
||||||
{
|
{
|
||||||
rp[0] = '\\';
|
rp[0] = '\'';
|
||||||
rp[1] = '\'';
|
rp[1] = '\'';
|
||||||
rp += 2;
|
rp += 2;
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
* procedural language
|
* procedural language
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.64.4.3 2005/02/08 18:21:59 tgl Exp $
|
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.64.4.4 2006/05/21 19:57:39 momjian Exp $
|
||||||
*
|
*
|
||||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||||
*
|
*
|
||||||
@@ -389,7 +389,7 @@ decl_statement : decl_varname decl_const decl_datatype decl_notnull decl_defval
|
|||||||
while (*cp1 != '\0')
|
while (*cp1 != '\0')
|
||||||
{
|
{
|
||||||
if (*cp1 == '\\' || *cp1 == '\'')
|
if (*cp1 == '\\' || *cp1 == '\'')
|
||||||
*cp2++ = '\\';
|
*cp2++ = *cp1;
|
||||||
*cp2++ = *cp1++;
|
*cp2++ = *cp1++;
|
||||||
}
|
}
|
||||||
strcpy(cp2, "'::refcursor");
|
strcpy(cp2, "'::refcursor");
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
--
|
--
|
||||||
-- Copyright (c) 1994-5, Regents of the University of California
|
-- Copyright (c) 1994-5, Regents of the University of California
|
||||||
--
|
--
|
||||||
-- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.7 2003/11/29 22:41:33 pgsql Exp $
|
-- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.7.4.1 2006/05/21 19:57:40 momjian Exp $
|
||||||
--
|
--
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -76,10 +76,10 @@ WHERE EMP.cubicle ~= '(2,1)'::point;
|
|||||||
-- columns of EMP.
|
-- columns of EMP.
|
||||||
|
|
||||||
CREATE FUNCTION new_emp() RETURNS EMP
|
CREATE FUNCTION new_emp() RETURNS EMP
|
||||||
AS 'SELECT \'None\'::text AS name,
|
AS 'SELECT ''None''::text AS name,
|
||||||
1000 AS salary,
|
1000 AS salary,
|
||||||
25 AS age,
|
25 AS age,
|
||||||
\'(2,2)\'::point AS cubicle'
|
''(2,2)''::point AS cubicle'
|
||||||
LANGUAGE 'sql';
|
LANGUAGE 'sql';
|
||||||
|
|
||||||
-- you can then project a column out of resulting the tuple by using the
|
-- you can then project a column out of resulting the tuple by using the
|
||||||
|
Reference in New Issue
Block a user