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
135dea63
Commit
135dea63
authored
Aug 10, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Since PQoidStatus is deprecated, we should probably stop using it in
our own code ...
parent
633b5d56
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
16 deletions
+22
-16
doc/src/sgml/libpq.sgml
doc/src/sgml/libpq.sgml
+9
-6
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+2
-2
src/interfaces/ecpg/lib/execute.c
src/interfaces/ecpg/lib/execute.c
+3
-3
src/interfaces/libpgtcl/pgtclCmds.c
src/interfaces/libpgtcl/pgtclCmds.c
+8
-5
No files found.
doc/src/sgml/libpq.sgml
View file @
135dea63
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.6
5 2001/08/10 14:42:47 momjian
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.6
6 2001/08/10 22:50:09 tgl
Exp $
-->
-->
<chapter id="libpq">
<chapter id="libpq">
...
@@ -1073,8 +1073,9 @@ char * PQcmdTuples(const PGresult *res);
...
@@ -1073,8 +1073,9 @@ char * PQcmdTuples(const PGresult *res);
<listitem>
<listitem>
<para>
<para>
<function>PQoidValue</function>
<function>PQoidValue</function>
Returns the object id of the tuple
Returns the object id of the tuple inserted, if the
inserted, if the <acronym>SQL</acronym> command was an INSERT.
<acronym>SQL</acronym> command was an INSERT
that inserted exactly one row into a table that has OIDs.
Otherwise, returns <literal>InvalidOid</literal>.
Otherwise, returns <literal>InvalidOid</literal>.
<synopsis>
<synopsis>
Oid PQoidValue(const PGresult *res);
Oid PQoidValue(const PGresult *res);
...
@@ -1088,9 +1089,11 @@ Oid PQoidValue(const PGresult *res);
...
@@ -1088,9 +1089,11 @@ Oid PQoidValue(const PGresult *res);
<listitem>
<listitem>
<para>
<para>
<function>PQoidStatus</function>
<function>PQoidStatus</function>
Returns a string with the object id of the tuple
Returns a string with the object id of the tuple inserted, if the
inserted, if the <acronym>SQL</acronym> command was an INSERT.
<acronym>SQL</acronym> command was an INSERT.
Otherwise, returns an empty string.
(The string will be "0" if the INSERT did not insert exactly one
row, or if the target table does not have OIDs.) If the command
was not an INSERT, returns an empty string.
<synopsis>
<synopsis>
char * PQoidStatus(const PGresult *res);
char * PQoidStatus(const PGresult *res);
</synopsis>
</synopsis>
...
...
src/bin/pg_dump/pg_dump.c
View file @
135dea63
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.2
19 2001/08/10 18:57:38
tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.2
20 2001/08/10 22:50:09
tgl Exp $
*
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
*
...
@@ -4698,7 +4698,7 @@ setMaxOid(Archive *fout)
...
@@ -4698,7 +4698,7 @@ setMaxOid(Archive *fout)
write_msg
(
NULL
,
"could not insert into pgdump_oid table: %s"
,
PQerrorMessage
(
g_conn
));
write_msg
(
NULL
,
"could not insert into pgdump_oid table: %s"
,
PQerrorMessage
(
g_conn
));
exit_nicely
();
exit_nicely
();
}
}
max_oid
=
atooid
(
PQoidStatus
(
res
)
);
max_oid
=
PQoidValue
(
res
);
if
(
max_oid
==
0
)
if
(
max_oid
==
0
)
{
{
write_msg
(
NULL
,
"inserted invalid oid
\n
"
);
write_msg
(
NULL
,
"inserted invalid oid
\n
"
);
...
...
src/interfaces/ecpg/lib/execute.c
View file @
135dea63
...
@@ -937,7 +937,7 @@ ECPGexecute(struct statement * stmt)
...
@@ -937,7 +937,7 @@ ECPGexecute(struct statement * stmt)
break
;
break
;
case
PGRES_COMMAND_OK
:
case
PGRES_COMMAND_OK
:
status
=
true
;
status
=
true
;
sqlca
.
sqlerrd
[
1
]
=
atol
(
PQoidStatus
(
results
)
);
sqlca
.
sqlerrd
[
1
]
=
PQoidValue
(
results
);
sqlca
.
sqlerrd
[
2
]
=
atol
(
PQcmdTuples
(
results
));
sqlca
.
sqlerrd
[
2
]
=
atol
(
PQcmdTuples
(
results
));
ECPGlog
(
"ECPGexecute line %d Ok: %s
\n
"
,
stmt
->
lineno
,
PQcmdStatus
(
results
));
ECPGlog
(
"ECPGexecute line %d Ok: %s
\n
"
,
stmt
->
lineno
,
PQcmdStatus
(
results
));
if
(
!
sqlca
.
sqlerrd
[
2
]
&&
(
!
strncmp
(
PQcmdStatus
(
results
),
"UPDATE"
,
6
)
if
(
!
sqlca
.
sqlerrd
[
2
]
&&
(
!
strncmp
(
PQcmdStatus
(
results
),
"UPDATE"
,
6
)
...
@@ -1032,7 +1032,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
...
@@ -1032,7 +1032,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
*
*
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
*
*
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.
19 2001/03/22 04:01:19 momjian
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.
20 2001/08/10 22:50:10 tgl
Exp $
*/
*/
PGconn
*
ECPG_internal_get_connection
(
char
*
name
);
PGconn
*
ECPG_internal_get_connection
(
char
*
name
);
...
@@ -1101,7 +1101,7 @@ execute_descriptor(int lineno, const char *query
...
@@ -1101,7 +1101,7 @@ execute_descriptor(int lineno, const char *query
break
;
break
;
case
PGRES_COMMAND_OK
:
case
PGRES_COMMAND_OK
:
status
=
true
;
status
=
true
;
sqlca
.
sqlerrd
[
1
]
=
atol
(
PQoidStatus
(
results
)
);
sqlca
.
sqlerrd
[
1
]
=
PQoidValue
(
results
);
sqlca
.
sqlerrd
[
2
]
=
atol
(
PQcmdTuples
(
results
));
sqlca
.
sqlerrd
[
2
]
=
atol
(
PQcmdTuples
(
results
));
ECPGlog
(
"ECPGexecute line %d Ok: %s
\n
"
,
lineno
,
PQcmdStatus
(
results
));
ECPGlog
(
"ECPGexecute line %d Ok: %s
\n
"
,
lineno
,
PQcmdStatus
(
results
));
break
;
break
;
...
...
src/interfaces/libpgtcl/pgtclCmds.c
View file @
135dea63
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.5
5 2001/03/22 04:01:23 momjian
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.5
6 2001/08/10 22:50:10 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -574,7 +574,7 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int argc, char *argv[])
...
@@ -574,7 +574,7 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int argc, char *argv[])
return
PgGetConnByResultId
(
interp
,
argv
[
1
]);
return
PgGetConnByResultId
(
interp
,
argv
[
1
]);
else
if
(
strcmp
(
opt
,
"-oid"
)
==
0
)
else
if
(
strcmp
(
opt
,
"-oid"
)
==
0
)
{
{
Tcl_AppendResult
(
interp
,
PQoidStatus
(
result
),
0
);
sprintf
(
interp
->
result
,
"%u"
,
PQoidValue
(
result
)
);
return
TCL_OK
;
return
TCL_OK
;
}
}
else
if
(
strcmp
(
opt
,
"-clear"
)
==
0
)
else
if
(
strcmp
(
opt
,
"-clear"
)
==
0
)
...
@@ -900,12 +900,15 @@ Pg_execute(ClientData cData, Tcl_Interp *interp, int argc, char *argv[])
...
@@ -900,12 +900,15 @@ Pg_execute(ClientData cData, Tcl_Interp *interp, int argc, char *argv[])
/*
/*
* Set the oid variable to the returned oid of an INSERT statement if
* Set the oid variable to the returned oid of an INSERT statement if
* requested (or
an empty string
if it wasn't an INSERT)
* requested (or
0
if it wasn't an INSERT)
*/
*/
if
(
oid_varname
!=
NULL
)
if
(
oid_varname
!=
NULL
)
{
{
if
(
Tcl_SetVar
(
interp
,
oid_varname
,
char
oid_buf
[
32
];
PQoidStatus
(
result
),
TCL_LEAVE_ERR_MSG
)
!=
TCL_OK
)
sprintf
(
oid_buf
,
"%u"
,
PQoidValue
(
result
));
if
(
Tcl_SetVar
(
interp
,
oid_varname
,
oid_buf
,
TCL_LEAVE_ERR_MSG
)
!=
TCL_OK
)
{
{
PQclear
(
result
);
PQclear
(
result
);
return
TCL_ERROR
;
return
TCL_ERROR
;
...
...
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