Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf3e122f

Browse files
committed
Restore dblink_current_query() to being a C-language function, so as to not
create an ABI break between 8.3 and 8.4. It is still just a wrapper aroundthe built-in current_query() function, but at a different implementationlevel. Per my proposal.Note: this change doesn't break 8.4beta installations, since theirSQL-language definition of the function still works fine.
1 parente8f28cb commitf3e122f

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

‎contrib/dblink/dblink.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Darko Prenosil <Darko.Prenosil@finteh.hr>
99
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
1010
*
11-
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.80 2009/06/0916:35:36 joe Exp $
11+
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.81 2009/06/0917:41:02 tgl Exp $
1212
* Copyright (c) 2001-2009, PostgreSQL Global Development Group
1313
* ALL RIGHTS RESERVED;
1414
*
@@ -1622,6 +1622,20 @@ dblink_build_sql_update(PG_FUNCTION_ARGS)
16221622
PG_RETURN_TEXT_P(cstring_to_text(sql));
16231623
}
16241624

1625+
/*
1626+
* dblink_current_query
1627+
* return the current query string
1628+
* to allow its use in (among other things)
1629+
* rewrite rules
1630+
*/
1631+
PG_FUNCTION_INFO_V1(dblink_current_query);
1632+
Datum
1633+
dblink_current_query(PG_FUNCTION_ARGS)
1634+
{
1635+
/* This is now just an alias for the built-in function current_query() */
1636+
PG_RETURN_DATUM(current_query(fcinfo));
1637+
}
1638+
16251639
/*************************************************************
16261640
* internal functions
16271641
*/

‎contrib/dblink/dblink.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Darko Prenosil <Darko.Prenosil@finteh.hr>
99
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
1010
*
11-
* $PostgreSQL: pgsql/contrib/dblink/dblink.h,v 1.21 2009/01/01 17:23:32 momjian Exp $
11+
* $PostgreSQL: pgsql/contrib/dblink/dblink.h,v 1.22 2009/06/09 17:41:02 tgl Exp $
1212
* Copyright (c) 2001-2009, PostgreSQL Global Development Group
1313
* ALL RIGHTS RESERVED;
1414
*
@@ -56,5 +56,6 @@ extern Datum dblink_get_pkey(PG_FUNCTION_ARGS);
5656
externDatumdblink_build_sql_insert(PG_FUNCTION_ARGS);
5757
externDatumdblink_build_sql_delete(PG_FUNCTION_ARGS);
5858
externDatumdblink_build_sql_update(PG_FUNCTION_ARGS);
59+
externDatumdblink_current_query(PG_FUNCTION_ARGS);
5960

6061
#endif/* DBLINK_H */

‎contrib/dblink/dblink.sql.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/contrib/dblink/dblink.sql.in,v 1.17 2008/04/05 02:44:42 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/contrib/dblink/dblink.sql.in,v 1.18 2009/06/09 17:41:02 tgl Exp $ */
22

33
-- Adjust this setting to control where the objects get created.
44
SET search_path = public;
@@ -165,8 +165,8 @@ LANGUAGE C STRICT;
165165

166166
CREATE OR REPLACE FUNCTION dblink_current_query ()
167167
RETURNS text
168-
AS 'SELECT pg_catalog.current_query()'
169-
LANGUAGESQL;
168+
AS 'MODULE_PATHNAME','dblink_current_query'
169+
LANGUAGEC;
170170

171171
CREATE OR REPLACE FUNCTION dblink_send_query(text, text)
172172
RETURNS int4

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp