Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
41b810fe
Commit
41b810fe
authored
Aug 14, 2010
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix \ef and \sf to not fail on functions with nonnull probin.
Update comment about them in pg_get_functiondef.
parent
b6e06942
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/ruleutils.c
+4
-3
src/bin/psql/command.c
src/bin/psql/command.c
+11
-11
No files found.
src/backend/utils/adt/ruleutils.c
View file @
41b810fe
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.33
1 2010/08/12 00:40:59
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.33
2 2010/08/14 14:20:35
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1622,8 +1622,9 @@ pg_get_serial_sequence(PG_FUNCTION_ARGS)
* the specified function.
*
* Note: if you change the output format of this function, be careful not
* to break psql's rules (in \ef) for identifying the start of the function
* body.
* to break psql's rules (in \ef and \sf) for identifying the start of the
* function body. To wit: the function body starts on a line that begins
* with "AS ", and no preceding line will look like that.
*/
Datum
pg_get_functiondef
(
PG_FUNCTION_ARGS
)
...
...
src/bin/psql/command.c
View file @
41b810fe
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.22
7 2010/08/14 13:59:49
tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.22
8 2010/08/14 14:20:35
tgl Exp $
*/
#include "postgres_fe.h"
#include "command.h"
...
...
@@ -611,17 +611,17 @@ exec_command(const char *cmd,
/*
* lineno "1" should correspond to the first line of the
* function body. We expect that pg_get_functiondef() will
* emit that on a line beginning with "AS
$function", and that
*
there can be no such line before the real start of the
*
function body. Increment lineno by the number of lines
*
before that line, so that it becomes relative to the first
*
line of the
function definition.
* emit that on a line beginning with "AS
", and that there
*
can be no such line before the real start of the function
*
body. Increment lineno by the number of lines before that
*
line, so that it becomes relative to the first line of the
* function definition.
*/
const
char
*
lines
=
query_buf
->
data
;
while
(
*
lines
!=
'\0'
)
{
if
(
strncmp
(
lines
,
"AS
$function"
,
12
)
==
0
)
if
(
strncmp
(
lines
,
"AS
"
,
3
)
==
0
)
break
;
lineno
++
;
/* find start of next line */
...
...
@@ -1150,9 +1150,9 @@ exec_command(const char *cmd,
/*
* lineno "1" should correspond to the first line of the
* function body. We expect that pg_get_functiondef() will
* emit that on a line beginning with "AS
$function", and that
*
there can be no such line before the real start of the
*
function
body.
* emit that on a line beginning with "AS
", and that there
*
can be no such line before the real start of the function
* body.
*
* Note that this loop scribbles on func_buf.
*/
...
...
@@ -1160,7 +1160,7 @@ exec_command(const char *cmd,
{
char
*
eol
;
if
(
in_header
&&
strncmp
(
lines
,
"AS
$function"
,
12
)
==
0
)
if
(
in_header
&&
strncmp
(
lines
,
"AS
"
,
3
)
==
0
)
in_header
=
false
;
/* increment lineno only for body's lines */
if
(
!
in_header
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment